This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch protobuf-maven
in repository https://gitbox.apache.org/repos/asf/camel.git

commit e2dc9b64af271f25f2520af2e4c433181ca2ca46
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Thu Jun 13 15:43:55 2024 +0200

    CAMEL-20788: Update camel to use a newer protobuf-maven-plugin for gRPC. 
Thanks to Craig Ziesman for the patch.
---
 components/camel-grpc/pom.xml                      | 23 ++++++++++---------
 components/camel-protobuf/pom.xml                  | 26 +++++++++++++---------
 .../camel-salesforce-component/README.md           |  4 ++++
 .../camel-salesforce-component/pom.xml             | 21 +++++++++++------
 parent/pom.xml                                     |  2 +-
 5 files changed, 47 insertions(+), 29 deletions(-)

diff --git a/components/camel-grpc/pom.xml b/components/camel-grpc/pom.xml
index e5b2f509c3b..8025d9c323b 100644
--- a/components/camel-grpc/pom.xml
+++ b/components/camel-grpc/pom.xml
@@ -194,23 +194,26 @@
 
             <!-- gRPC and protobuf Java code generator plugin -->
             <plugin>
-                <groupId>org.xolstice.maven.plugins</groupId>
+                <groupId>io.github.ascopes</groupId>
                 <artifactId>protobuf-maven-plugin</artifactId>
                 <version>${protobuf-maven-plugin-version}</version>
                 <configuration>
-                    
<protocArtifact>com.google.protobuf:protoc:${protobuf-version}:exe:${os.detected.classifier}
-                    </protocArtifact>
-                    <pluginId>grpc-java</pluginId>
-                    
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc-version}:exe:${os.detected.classifier}
-                    </pluginArtifact>
-                    <checkStaleness>true</checkStaleness>
-                    <skip>${skipTests}</skip>
+                    <protocVersion>${protobuf-version}</protocVersion>
+                    <sourceDirectories>
+                        <sourceDirectory>src/test/proto</sourceDirectory>
+                    </sourceDirectories>
+                    <binaryMavenPlugins>
+                        <binaryMavenPlugin>
+                            <groupId>io.grpc</groupId>
+                            <artifactId>protoc-gen-grpc-java</artifactId>
+                            <version>${grpc-version}</version>
+                        </binaryMavenPlugin>
+                    </binaryMavenPlugins>
                 </configuration>
                 <executions>
                     <execution>
                         <goals>
-                            <goal>test-compile</goal>
-                            <goal>test-compile-custom</goal>
+                            <goal>generate-test</goal>
                         </goals>
                     </execution>
                 </executions>
diff --git a/components/camel-protobuf/pom.xml 
b/components/camel-protobuf/pom.xml
index 8169d029ae6..2964a468e17 100644
--- a/components/camel-protobuf/pom.xml
+++ b/components/camel-protobuf/pom.xml
@@ -115,26 +115,30 @@
 
             <!-- Protobuf Java code generator plugin -->
             <plugin>
-                <groupId>org.xolstice.maven.plugins</groupId>
+                <groupId>io.github.ascopes</groupId>
                 <artifactId>protobuf-maven-plugin</artifactId>
                 <version>${protobuf-maven-plugin-version}</version>
-                <extensions>true</extensions>
+                <configuration>
+                    <protocVersion>${protobuf-version}</protocVersion>
+                    <sourceDirectories>
+                        <sourceDirectory>src/test/proto</sourceDirectory>
+                    </sourceDirectories>
+                    <binaryMavenPlugins>
+                        <binaryMavenPlugin>
+                            <groupId>io.grpc</groupId>
+                            <artifactId>protoc-gen-grpc-java</artifactId>
+                            <version>${grpc-version}</version>
+                        </binaryMavenPlugin>
+                    </binaryMavenPlugins>
+                </configuration>
                 <executions>
                     <execution>
                         <goals>
-                            <goal>test-compile</goal>
+                            <goal>generate-test</goal>
                         </goals>
-                        <configuration>
-                            <protocArtifact>
-                                
com.google.protobuf:protoc:${protobuf-version}:exe:${os.detected.classifier}
-                            </protocArtifact>
-                            <checkStaleness>true</checkStaleness>
-                            <skip>${skipTests}</skip>
-                        </configuration>
                     </execution>
                 </executions>
             </plugin>
-
             <plugin>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <executions>
diff --git a/components/camel-salesforce/camel-salesforce-component/README.md 
b/components/camel-salesforce/camel-salesforce-component/README.md
index ce9809bfca6..51279b72e34 100644
--- a/components/camel-salesforce/camel-salesforce-component/README.md
+++ b/components/camel-salesforce/camel-salesforce-component/README.md
@@ -5,6 +5,10 @@ There is a companion maven plugin 
[camel-salesforce-plugin](https://github.com/a
 
 ## Developing the Camel Salesforce component
 
+### Building on Windows/ARM
+
+**Note:** There is no `protoc` compiler available for Windows on ARM, so this 
component will fail to build in that environment. An issue has been raised 
against the `protobuf` project to request an executable for Windows on ARM. 
https://github.com/protocolbuffers/protobuf/issues/16877
+
 ### Running the integration tests
 
 **Note:** These instructions are only for running integration tests, they use 
permissions and IP restrictions that should be reconsidered for production use. 
diff --git a/components/camel-salesforce/camel-salesforce-component/pom.xml 
b/components/camel-salesforce/camel-salesforce-component/pom.xml
index 642c9bb3e98..745ef97e658 100644
--- a/components/camel-salesforce/camel-salesforce-component/pom.xml
+++ b/components/camel-salesforce/camel-salesforce-component/pom.xml
@@ -256,19 +256,26 @@
                 </executions>
             </plugin>
             <plugin>
-                <groupId>org.xolstice.maven.plugins</groupId>
+                <groupId>io.github.ascopes</groupId>
                 <artifactId>protobuf-maven-plugin</artifactId>
                 <version>${protobuf-maven-plugin-version}</version>
                 <configuration>
-                    
<protocArtifact>com.google.protobuf:protoc:${protobuf-version}:exe:${os.detected.classifier}</protocArtifact>
-                    <pluginId>grpc-java</pluginId>
-                    
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc-version}:exe:${os.detected.classifier}</pluginArtifact>
+                    <protocVersion>${protobuf-version}</protocVersion>
+                    <sourceDirectories>
+                        <sourceDirectory>src/main/proto</sourceDirectory>
+                    </sourceDirectories>
+                    <binaryMavenPlugins>
+                        <binaryMavenPlugin>
+                            <groupId>io.grpc</groupId>
+                            <artifactId>protoc-gen-grpc-java</artifactId>
+                            <version>${grpc-version}</version>
+                        </binaryMavenPlugin>
+                    </binaryMavenPlugins>
                 </configuration>
                 <executions>
                     <execution>
                         <goals>
-                            <goal>compile</goal>
-                            <goal>compile-custom</goal>
+                            <goal>generate</goal>
                         </goals>
                     </execution>
                 </executions>
@@ -283,7 +290,7 @@
                             <target>
                                 <replace token= "@javax.annotation.Generated"
                                          value="@jakarta.annotation.Generated"
-                                         
dir="target/generated-sources/protobuf/grpc-java">
+                                         
dir="target/generated-sources/protobuf">
                                     <include name="**/*.java"/>
                                 </replace>
                             </target>
diff --git a/parent/pom.xml b/parent/pom.xml
index 4095c537bcb..c90c4dd8c13 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -404,7 +404,7 @@
         
<properties-maven-plugin-version>1.2.1</properties-maven-plugin-version>
         
<proto-google-common-protos-version>2.22.0</proto-google-common-protos-version>
         <protobuf-version>3.25.3</protobuf-version>
-        <protobuf-maven-plugin-version>0.6.1</protobuf-maven-plugin-version>
+        <protobuf-maven-plugin-version>2.1.4</protobuf-maven-plugin-version>
         <protonpack-version>1.8</protonpack-version>
         <protostream-version>5.0.5.Final</protostream-version>
         <prowide-version>SRU2023-10.1.6</prowide-version>

Reply via email to