You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Luigi De Masi (Jira)" <ji...@apache.org> on 2023/09/18 10:47:00 UTC

[jira] [Created] (CAMEL-19880) camel-salesforce: component still depends on javax.annotation-api

Luigi De Masi created CAMEL-19880:
-------------------------------------

             Summary: camel-salesforce: component still depends on javax.annotation-api
                 Key: CAMEL-19880
                 URL: https://issues.apache.org/jira/browse/CAMEL-19880
             Project: Camel
          Issue Type: Improvement
            Reporter: Luigi De Masi
            Assignee: Luigi De Masi


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:
{code:java|title=PubSubGrpc.java|borderStyle=solid}
@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 {
{code}
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:
{code:xml|title=pom.xml|borderStyle=solid}
<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>
{code}

[~davsclaus] [~acosentino] WDYT?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)