From 66ad5eaceb289ecbc33792da444f651f05f1917a Mon Sep 17 00:00:00 2001 From: Andrey Litvitski Date: Wed, 21 May 2025 21:51:26 +0300 Subject: [PATCH] switch maven samples to `ascopes/protobuf-maven-plugin` protoc plugin (#179) Signed-off-by: Andrey Litvitski --- samples/grpc-client/pom.xml | 27 +++++----- .../src/main/{proto => protobuf}/hello.proto | 0 samples/grpc-oauth2/pom.xml | 27 +++++----- .../src/main/{proto => protobuf}/hello.proto | 0 samples/grpc-reactive/pom.xml | 43 +++++++-------- .../src/main/{proto => protobuf}/hello.proto | 0 samples/grpc-secure/pom.xml | 27 +++++----- .../src/main/{proto => protobuf}/hello.proto | 0 samples/grpc-server-kotlin/pom.xml | 52 +++++++------------ .../src/main/{proto => protobuf}/hello.proto | 0 samples/grpc-server-netty-shaded/pom.xml | 29 ++++++----- .../src/main/{proto => protobuf}/hello.proto | 0 samples/grpc-server/pom.xml | 27 +++++----- .../src/main/{proto => protobuf}/hello.proto | 0 samples/grpc-tomcat-secure/pom.xml | 29 ++++++----- .../src/main/{proto => protobuf}/hello.proto | 0 samples/grpc-tomcat/pom.xml | 29 ++++++----- .../src/main/{proto => protobuf}/hello.proto | 0 samples/grpc-webflux/pom.xml | 27 +++++----- .../src/main/{proto => protobuf}/hello.proto | 0 20 files changed, 150 insertions(+), 167 deletions(-) rename samples/grpc-client/src/main/{proto => protobuf}/hello.proto (100%) rename samples/grpc-oauth2/src/main/{proto => protobuf}/hello.proto (100%) rename samples/grpc-reactive/src/main/{proto => protobuf}/hello.proto (100%) rename samples/grpc-secure/src/main/{proto => protobuf}/hello.proto (100%) rename samples/grpc-server-kotlin/src/main/{proto => protobuf}/hello.proto (100%) rename samples/grpc-server-netty-shaded/src/main/{proto => protobuf}/hello.proto (100%) rename samples/grpc-server/src/main/{proto => protobuf}/hello.proto (100%) rename samples/grpc-tomcat-secure/src/main/{proto => protobuf}/hello.proto (100%) rename samples/grpc-tomcat/src/main/{proto => protobuf}/hello.proto (100%) rename samples/grpc-webflux/src/main/{proto => protobuf}/hello.proto (100%) diff --git a/samples/grpc-client/pom.xml b/samples/grpc-client/pom.xml index 1e6b31e1..1b4b6cb3 100644 --- a/samples/grpc-client/pom.xml +++ b/samples/grpc-client/pom.xml @@ -110,26 +110,25 @@ - org.xolstice.maven.plugins + io.github.ascopes protobuf-maven-plugin - 0.6.1 + 3.1.2 - - com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier} - grpc-java - - io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} + ${protobuf-java.version} + + + io.grpc + protoc-gen-grpc-java + ${grpc.version} + ${os.detected.classifier} + jakarta_omit,@generated=omit + + - - - jakarta_omit,@generated=omit - - - compile - compile-custom + generate diff --git a/samples/grpc-client/src/main/proto/hello.proto b/samples/grpc-client/src/main/protobuf/hello.proto similarity index 100% rename from samples/grpc-client/src/main/proto/hello.proto rename to samples/grpc-client/src/main/protobuf/hello.proto diff --git a/samples/grpc-oauth2/pom.xml b/samples/grpc-oauth2/pom.xml index 6d4edd54..3886a76d 100644 --- a/samples/grpc-oauth2/pom.xml +++ b/samples/grpc-oauth2/pom.xml @@ -121,26 +121,25 @@ - org.xolstice.maven.plugins + io.github.ascopes protobuf-maven-plugin - 0.6.1 + 3.1.2 - - com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier} - grpc-java - - io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} + ${protobuf-java.version} + + + io.grpc + protoc-gen-grpc-java + ${grpc.version} + ${os.detected.classifier} + jakarta_omit,@generated=omit + + - - - jakarta_omit,@generated=omit - - - compile - compile-custom + generate diff --git a/samples/grpc-oauth2/src/main/proto/hello.proto b/samples/grpc-oauth2/src/main/protobuf/hello.proto similarity index 100% rename from samples/grpc-oauth2/src/main/proto/hello.proto rename to samples/grpc-oauth2/src/main/protobuf/hello.proto diff --git a/samples/grpc-reactive/pom.xml b/samples/grpc-reactive/pom.xml index 8ce10d5a..4d8df625 100644 --- a/samples/grpc-reactive/pom.xml +++ b/samples/grpc-reactive/pom.xml @@ -136,35 +136,32 @@ - org.xolstice.maven.plugins + io.github.ascopes protobuf-maven-plugin - 0.6.1 + 3.1.2 - - com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier} - grpc-java - - io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} + ${protobuf-java.version} + + + io.grpc + protoc-gen-grpc-java + ${grpc.version} + ${os.detected.classifier} + jakarta_omit,@generated=omit + + + + + com.salesforce.servicelibs + reactor-grpc + 1.2.4 + + - - - jakarta_omit,@generated=omit - - - - reactor-grpc - com.salesforce.servicelibs - reactor-grpc - 1.2.4 - com.salesforce.reactorgrpc.ReactorGrpcGenerator - - - - compile - compile-custom + generate diff --git a/samples/grpc-reactive/src/main/proto/hello.proto b/samples/grpc-reactive/src/main/protobuf/hello.proto similarity index 100% rename from samples/grpc-reactive/src/main/proto/hello.proto rename to samples/grpc-reactive/src/main/protobuf/hello.proto diff --git a/samples/grpc-secure/pom.xml b/samples/grpc-secure/pom.xml index 5342b340..f76707ef 100644 --- a/samples/grpc-secure/pom.xml +++ b/samples/grpc-secure/pom.xml @@ -114,26 +114,25 @@ - org.xolstice.maven.plugins + io.github.ascopes protobuf-maven-plugin - 0.6.1 + 3.1.2 - - com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier} - grpc-java - - io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} + ${protobuf-java.version} + + + io.grpc + protoc-gen-grpc-java + ${grpc.version} + ${os.detected.classifier} + jakarta_omit,@generated=omit + + - - - jakarta_omit,@generated=omit - - - compile - compile-custom + generate diff --git a/samples/grpc-secure/src/main/proto/hello.proto b/samples/grpc-secure/src/main/protobuf/hello.proto similarity index 100% rename from samples/grpc-secure/src/main/proto/hello.proto rename to samples/grpc-secure/src/main/protobuf/hello.proto diff --git a/samples/grpc-server-kotlin/pom.xml b/samples/grpc-server-kotlin/pom.xml index 456f94da..9523d18f 100644 --- a/samples/grpc-server-kotlin/pom.xml +++ b/samples/grpc-server-kotlin/pom.xml @@ -148,53 +148,41 @@ - org.xolstice.maven.plugins + io.github.ascopes protobuf-maven-plugin - 0.6.1 + 3.1.2 - - com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier} - - grpc-java - - io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} - - - - grpc-kotlin + ${protobuf-java.version} + + + io.grpc + protoc-gen-grpc-java + ${grpc.version} + ${os.detected.classifier} + jakarta_omit,@generated=omit + + + + io.grpc protoc-gen-grpc-kotlin ${grpc.kotlin.version} jdk8 + jar io.grpc.kotlin.generator.GeneratorRunner - - + jakarta_omit,@generated=omit + + - - - jakarta_omit,@generated=omit - - - compile - compile-custom + generate - - org.apache.maven.plugins - maven-surefire-plugin - 3.1.2 - - false - - **/*.class - - - + diff --git a/samples/grpc-server-kotlin/src/main/proto/hello.proto b/samples/grpc-server-kotlin/src/main/protobuf/hello.proto similarity index 100% rename from samples/grpc-server-kotlin/src/main/proto/hello.proto rename to samples/grpc-server-kotlin/src/main/protobuf/hello.proto diff --git a/samples/grpc-server-netty-shaded/pom.xml b/samples/grpc-server-netty-shaded/pom.xml index 4ed9f7d5..ba1a86fc 100644 --- a/samples/grpc-server-netty-shaded/pom.xml +++ b/samples/grpc-server-netty-shaded/pom.xml @@ -111,27 +111,28 @@ spring-boot-maven-plugin - org.xolstice.maven.plugins + io.github.ascopes protobuf-maven-plugin - 0.6.1 + 3.1.2 + + ${protobuf-java.version} + + + io.grpc + protoc-gen-grpc-java + ${grpc.version} + ${os.detected.classifier} + jakarta_omit,@generated=omit + + + - compile - compile-custom + generate - - - jakarta_omit,@generated=omit - - - com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier} - grpc-java - - io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} - diff --git a/samples/grpc-server-netty-shaded/src/main/proto/hello.proto b/samples/grpc-server-netty-shaded/src/main/protobuf/hello.proto similarity index 100% rename from samples/grpc-server-netty-shaded/src/main/proto/hello.proto rename to samples/grpc-server-netty-shaded/src/main/protobuf/hello.proto diff --git a/samples/grpc-server/pom.xml b/samples/grpc-server/pom.xml index 1442fa50..1b902102 100644 --- a/samples/grpc-server/pom.xml +++ b/samples/grpc-server/pom.xml @@ -117,26 +117,25 @@ - org.xolstice.maven.plugins + io.github.ascopes protobuf-maven-plugin - 0.6.1 + 3.1.2 - - com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier} - grpc-java - - io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} + ${protobuf-java.version} + + + io.grpc + protoc-gen-grpc-java + ${grpc.version} + ${os.detected.classifier} + jakarta_omit,@generated=omit + + - - - jakarta_omit,@generated=omit - - - compile - compile-custom + generate diff --git a/samples/grpc-server/src/main/proto/hello.proto b/samples/grpc-server/src/main/protobuf/hello.proto similarity index 100% rename from samples/grpc-server/src/main/proto/hello.proto rename to samples/grpc-server/src/main/protobuf/hello.proto diff --git a/samples/grpc-tomcat-secure/pom.xml b/samples/grpc-tomcat-secure/pom.xml index e8801bbe..4b1ab9af 100644 --- a/samples/grpc-tomcat-secure/pom.xml +++ b/samples/grpc-tomcat-secure/pom.xml @@ -109,27 +109,28 @@ - org.xolstice.maven.plugins + io.github.ascopes protobuf-maven-plugin - 0.6.1 + 3.1.2 + + ${protobuf-java.version} + + + io.grpc + protoc-gen-grpc-java + ${grpc.version} + ${os.detected.classifier} + jakarta_omit,@generated=omit + + + - compile - compile-custom + generate - - - jakarta_omit,@generated=omit - - - com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier} - grpc-java - - io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} - diff --git a/samples/grpc-tomcat-secure/src/main/proto/hello.proto b/samples/grpc-tomcat-secure/src/main/protobuf/hello.proto similarity index 100% rename from samples/grpc-tomcat-secure/src/main/proto/hello.proto rename to samples/grpc-tomcat-secure/src/main/protobuf/hello.proto diff --git a/samples/grpc-tomcat/pom.xml b/samples/grpc-tomcat/pom.xml index a984ef4f..6806f2eb 100644 --- a/samples/grpc-tomcat/pom.xml +++ b/samples/grpc-tomcat/pom.xml @@ -114,27 +114,28 @@ - org.xolstice.maven.plugins + io.github.ascopes protobuf-maven-plugin - 0.6.1 + 3.1.2 + + ${protobuf-java.version} + + + io.grpc + protoc-gen-grpc-java + ${grpc.version} + ${os.detected.classifier} + jakarta_omit,@generated=omit + + + - compile - compile-custom + generate - - - jakarta_omit,@generated=omit - - - com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier} - grpc-java - - io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} - diff --git a/samples/grpc-tomcat/src/main/proto/hello.proto b/samples/grpc-tomcat/src/main/protobuf/hello.proto similarity index 100% rename from samples/grpc-tomcat/src/main/proto/hello.proto rename to samples/grpc-tomcat/src/main/protobuf/hello.proto diff --git a/samples/grpc-webflux/pom.xml b/samples/grpc-webflux/pom.xml index 5576e3cb..84f60eb4 100644 --- a/samples/grpc-webflux/pom.xml +++ b/samples/grpc-webflux/pom.xml @@ -109,26 +109,25 @@ - org.xolstice.maven.plugins + io.github.ascopes protobuf-maven-plugin - 0.6.1 + 3.1.2 - - com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier} - grpc-java - - io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} + ${protobuf-java.version} + + + io.grpc + protoc-gen-grpc-java + ${grpc.version} + ${os.detected.classifier} + jakarta_omit,@generated=omit + + - - - jakarta_omit,@generated=omit - - - compile - compile-custom + generate diff --git a/samples/grpc-webflux/src/main/proto/hello.proto b/samples/grpc-webflux/src/main/protobuf/hello.proto similarity index 100% rename from samples/grpc-webflux/src/main/proto/hello.proto rename to samples/grpc-webflux/src/main/protobuf/hello.proto