Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
4.x
-
None
-
Unknown
Description
Is not possible at the moment to completely remove javax.annotation-api because this issue in grpc-java: https://github.com/grpc/grpc-java/issues/9179
Camel-Salesforce component uses gRPC to implement Pub/Sub API that allow to publish and subscribe to platform events, including real-time event monitoring events, and change data capture events.
grpc-java is used to generate com.salesforce.eventbus.protobuf.PubSubGrpc class that is generated with @javax.annotation.Generated annotation:
@javax.annotation.Generated( value = "by gRPC proto compiler (version 1.57.1)", comments = "Source: pubsub_api.proto") @io.grpc.stub.annotations.GrpcGenerated public final class PubSubGrpc {
that's why the javax.annotation-api dependency is still needed.
We can use a trick to overcome this limitation of grpc-java generator:
we can process the generated sources and replacing the @javax.annotation.Generated with the jakarta one using the antrun maven plugin:
<plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>process-sources</phase> <configuration> <target> <replace token= "@javax.annotation.Generated" value="@jakarta.annotation.Generated" dir="target/generated-sources/protobuf/grpc-java"> <include name="**/*.java"/> </replace> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin>
davsclaus acosentino WDYT?