xolstice / protobuf-maven-plugin

Maven Plugin that executes the Protocol Buffers (protoc) compiler
https://www.xolstice.org/protobuf-maven-plugin/
Other
236 stars 78 forks source link

Problem with @Generated annotation when upgrading jakarta-annotation-api to version 2.x #109

Closed ferblaca closed 1 year ago

ferblaca commented 1 year ago

When generating code from a .proto contract in Java, the @Generated annotation belonging to the javax.annotation package of the jakarta.annotation:jakarta.annotation-api:1.x.x library is added. For example:

@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.50.0)",
    comments = "Source: product.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class ProductEndPointGrpc {
...

When updating our projects to version 2.x of the jakarta.annotation:jakarta.annotation-api library, the javax.annotation package no longer exists, it is now jakarta.annotation, so the autogenerated code through the plugin does not work correctly.

It would be great if the plugin could be configured to be resilient to this kind of changes.

hatahet commented 1 year ago

I think this is an issue with grpc-java.