-
Notifications
You must be signed in to change notification settings - Fork 930
Switch gRPC plugin to io.github.ascopes:protobuf-maven-plugin #1805
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
base: main
Are you sure you want to change the base?
Conversation
A simple demo project with this fails with:
We need to add this to the configuration:
or we can change the generated empty directory from And i think the whole dance with |
I forgot about the proto file path. I think we should use the default, so (since we don’t ship samples from initializr with proto files) there’s nothing to do? Or can we create the empty directory as a hint? I didn’t know the os classifier wasn’t needed. Maybe we should verify on all platforms? It seems to work for me on Linux. UPDATE: I pushed some changes to align with comments above. |
Signed-off-by: Dave Syer <[email protected]>
N.B. I don't want to merge this yet until we either add an |
spring-io/initializr#1650 is in. |
So we can use that new API? |
Yeah, we can add processing instructions until the plugin authors release their new version. |
Signed-off-by: Dave Syer <[email protected]>
The maven plugin now uses |
We switched the project samples already and I think the gradle builds still work. I’ll have to check. The docs can be changed of course. UPDATE: it's a big mess. I will fix the samples in the gRPC project. I think you are right but I'm having some issues convincing the ascopes plugin to follow its configuration. |
This is what I currently have: <configuration>
<sourceDirectories>
<sourceDirectory>src/main/proto</sourceDirectory>
</sourceDirectories>
<failOnMissingSources>false</failOnMissingSources>
<protocVersion>${protobuf-java.version}</protocVersion>
<binaryMavenPlugins>
<binaryMavenPlugin>
<groupId>io.grpc</groupId>
<artifactId>protoc-gen-grpc-java</artifactId>
<version>${grpc.version}</version>
<options>jakarta_omit,@generated=omit</options>
</binaryMavenPlugin>
</binaryMavenPlugins>
</configuration> |
That should work for a standalone sample but it breaks if the app is not the top level in the Maven reactor. We can see if it can be fixed in the plugin (I opened an issue). I prefer to just use the default here for now, |
I added a new commit that changes the configuration in Gradle instead. You can decide how to do it. |
5ee5eac
to
f6e0129
Compare
Signed-off-by: Dave Syer <[email protected]>
The samples at Spring gRPC have all been switched to this other plugin because the old one has fallen out of maintenance. It works on the command line right now, but Eclipse/VSCode users will want the hints to drive the build. See spring-io/initializr#1650