-
Notifications
You must be signed in to change notification settings - Fork 29
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
protobuf-maven-plugin doesn't support protoc insertions #28
Comments
I spent some time digging into this. You're 100% correct about the lack of It also looks like the protobuf maven plugin invokes protoc once for each plugin defined. The I tried using the java plugin configuration since it seems to be the only available option for including java out arg. <plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<extensions>true</extensions>
<version>0.6.1</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.6.1:exe:${os.detected.classifier}</protocArtifact>
<outputDirectory>${basedir}/target/generated-sources/protobuf/java</outputDirectory>
<clearOutputDirectory>false</clearOutputDirectory>
<protocPlugins>
<plugin>
<id>kroto-plus</id>
<groupId>com.github.marcoferrer.krotoplus</groupId>
<artifactId>protoc-gen-kroto-plus</artifactId>
<version>${krotoplus.version}</version>
<classifier>jvm8</classifier>
<mainClass>org.springframework.boot.loader.JarLauncher</mainClass>
</plugin>
</protocPlugins>
</configuration>
<executions>
...
</executions>
</plugin>
I checked out the output from this configuration and it does indeed properly pass the java out arg BUT now theres a new issue. The protobuf maven plugin doesnt allow you to pass any I tried every supported configuration with no success. This looks like a bug in the maven plugin. |
Still doesn't work... Not really usable with maven :( |
I use maven and faced with a problem when had used your plugin.
Short log of problem is
[ERROR] PROTOC FAILED: some/path//SomeClass.java: Tried to insert into file that doesn't exist.
My pom.xml
as noticed there, there and there
Then I tried protobuf-gradle-plugin with settings
and that worked.
I ran command in debug mode and compare output protobuf-maven-plugin and protobuf-gradle-plugin.
protobuf-gradle-plugin run only one protoc command with pipe of plugins
--java_out --> --protoc-gen-grpc --> protoc-gen-kroto
protobuf-maven-plugin run protoc commands N executions times
and in my case last command is
that lead to build failure.
When I have added
--java_out=/api/target/generated-sources/protobuf/java
to command above. It worked fineI don't know which products this bug\behavior belongs to.
The text was updated successfully, but these errors were encountered: