Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDE integration problems #512

Closed
nikoncode opened this issue Jul 9, 2021 · 2 comments
Closed

IDE integration problems #512

nikoncode opened this issue Jul 9, 2021 · 2 comments

Comments

@nikoncode
Copy link

Hi. I am using protobuf plugin (v 0.8.16 / gradle version 6.9) and compilation itself working fine, but I have IntellijIdea integration problems

  1. IDE wasn't able to find generated classes. They are all red. Proto sources located in default directory src/main/proto and generated sources are located at build/generated/source/proto/main and according to documentation should be attached automatically.

This plugin integrates with the idea plugin and automatically registers the proto files and generated Java code as sources.

  1. I connected protoc-gen-validate extension and plugin successfully extracted include protos to build/extracted-include-protos/main/validate/validate.proto but IDE highlight import "validate/validate.proto"; red and wasn't able to locate it.

Content of my build gradle:

plugins {
	id 'org.springframework.boot' version '2.3.12.RELEASE'
	id 'io.spring.dependency-management' version '1.0.11.RELEASE'
	id 'com.google.protobuf' version '0.8.16'
	id 'java'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

repositories {
	mavenCentral()
	maven {
		url "https://packages.confluent.io/maven/"
	}
}

protobuf {
	plugins {
		javapgv {
			artifact = "io.envoyproxy.protoc-gen-validate:protoc-gen-validate:0.4.1"
		}
	}

	generateProtoTasks {
		all()*.plugins {
			javapgv {
				option "lang=java"
			}
		}
	}
}

dependencies {
	implementation 'io.confluent:kafka-protobuf-serializer:6.2.0'
	implementation 'org.springframework.boot:spring-boot-starter-validation'
	implementation 'org.springframework.boot:spring-boot-starter'
	implementation 'org.springframework.kafka:spring-kafka'
	implementation 'org.springframework.boot:spring-boot-starter-aop'
	implementation 'io.envoyproxy.protoc-gen-validate:pgv-java-stub:0.4.1'
	compileOnly 'org.projectlombok:lombok'
	annotationProcessor 'org.projectlombok:lombok'
	testImplementation('org.springframework.boot:spring-boot-starter-test') {
		exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
	}
	testImplementation 'org.springframework.kafka:spring-kafka-test'
}

test {
	useJUnitPlatform()
}
@nikoncode nikoncode changed the title Gradle integration problems IDE integration problems Jul 9, 2021
@nikoncode
Copy link
Author

Everything was solved by adding idea plugins w/o any configuration. Probably this plugin depends optionally on idea plugin.

@voidzcy
Copy link
Collaborator

voidzcy commented Jul 12, 2021

The issue should have been fixed by #506 but not released yet.

@voidzcy voidzcy closed this as completed Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants