-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
gRPC: Cannot seem to use the protobuf-maven-plugin instead of quarkus-maven #36074
Comments
/cc @alesj (grpc), @cescoffier (grpc), @quarkusio/devtools (maven) |
Any way to reproduce this? |
So I am currently documenting the two ways I'm trying to get compiling to work.
This current ticket is for the It is a branch of the |
We do not recommend using the gRPC maven plugin. If you really want to do it, follow the instructions from https://quarkus.io/guides/grpc-getting-started#protobuf-maven-plugin, and make sure your proto files are NOT in src/main/proto. The import issue looks like a bug we need to fix. |
@cescoffier ok, thanks for the update. There is a slight issue when still trying to use the plugin as you have documented.
Anyway, I've filed a bug with the git hub project for that plugin and asked on Stack Overflow for help. The plugin is no longer maintained so I don't know if it will get fixed. I can't imagine I'm the only person to hit this issue. As far as the import issue being fixed that would be great so we can generate gRPC code with our external dependencies as mentioned. <plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
<protocPlugins>
<protocPlugin>
<id>quarkus-grpc-protoc-plugin</id>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-grpc-protoc-plugin</artifactId>
<version>3.4.1</version>
<mainClass>io.quarkus.grpc.protoc.plugin.MutinyGrpcGenerator</mainClass>
</protocPlugin>
</protocPlugins>
<includes>
<include>${project.build.directory}/protobuf/base/protobuf/*.proto</include>
</includes>
<protoSourceRoot>${project.basedir}/src/main/protobuf</protoSourceRoot>
<checkStaleness>false</checkStaleness>
</configuration>
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<goals>
<goal>test-compile</goal>
<goal>test-compile-custom</goal>
</goals>
</execution>
</executions>
</plugin> |
Ok, turns out it was my fault and misread the docs for the I was using
I found it by cloning the repo for the plugin and stepping through the debugger and realized the error. |
I was able to get my code building with the I did have to add a dependency on:
because I would get compile errors about missing Looking forward to the official quarlus gRPC build method though. |
So, yes, the Maven plugin and protoc are still using the old javax |
Describe the bug
I originally wanted to use the built in grpc compiler built into Quarkus, but I'm having trouble getting it to handle external imports so I can reference my protos from an external jar which are nested in a folder off the root.
ie. protobuf/Foo.proto
So, I saw that we can use the
protobuf-maven-plugin
to configure more options.Following the link in the docs at https://quarkus.io/guides/grpc-getting-started#protobuf-maven-plugin I configured everything as mentioned.
I'm am using the
maven-dependency
plugin to pull our standard proto files store in Nexus and then we expand them into thetarget
folder so we can include them with theprotobuf-maven-plugin
.We do this in another non-quarkus project and it works fine, so I wanted to use this mechanism.
But, when I run the
mvn clean compile
a few things happen:It appears the
protobuf-maven-plugin
attempts to run but doesn't find any protos atsrc/main/proto
which is the default configuration according to the docs at: https://www.xolstice.org/protobuf-maven-plugin/compile-mojo.htmlwhich defines the
sourceRoot
assrc/main/proto
. I do have proto files in thesrc/main/proto
folder.It then appears that the default quarkus grpc compiler is still trying to run and is failing because of the import issues I am trying to fix.
Is there a way to turn off the default grpc compiling when using the other plugin? I didn't see anything in the docs.
Output
Expected behavior
protobuf-maven-plugin
then it should take precedence over the built in grpc compile in quarkus mavenActual behavior
No response
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.4.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: