Remove dependency on javax.annotation

This commit removes the directy dependency that was required
by the protoc compiler for our samples. The Maven and Gradle
now support an option to use an internal annotation which then
allows us to remove the deprecated javax.annotation dependency.

Background here: https://github.com/grpc/grpc-java/pull/10927
This commit is contained in:
Chris Bono
2024-10-20 11:57:37 -05:00
committed by Dave Syer
parent c856f71159
commit f31d6ad6f7
3 changed files with 17 additions and 15 deletions

View File

@@ -52,7 +52,9 @@ protobuf {
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
grpc {
option 'jakarta_omit'
}
}
}
}

View File

@@ -120,14 +120,6 @@
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
<configuration>
<protocArtifact>
com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier}</protocArtifact>
@@ -135,6 +127,19 @@
<pluginArtifact>
io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
<configuration>
<pluginParameter>
jakarta_omit
</pluginParameter>
</configuration>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

View File

@@ -47,11 +47,6 @@
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>