Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-19880

camel-salesforce: component still depends on javax.annotation-api

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.x
    • 4.1.0
    • camel-salesforce
    • 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:

      PubSubGrpc.java
      @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:

      pom.xml
      <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?

      Attachments

        Activity

          People

            ldemasi Luigi De Masi
            ldemasi Luigi De Masi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: