Skip to content

Commit f31d6ad

Browse files
onobcdsyer
authored andcommitted
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: grpc/grpc-java#10927
1 parent c856f71 commit f31d6ad

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

samples/grpc-server/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ protobuf {
5252
}
5353
generateProtoTasks {
5454
all()*.plugins {
55-
grpc {}
56-
}
55+
grpc {
56+
option 'jakarta_omit'
57+
}
58+
}
5759
}
5860
}

samples/grpc-server/pom.xml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,21 +120,26 @@
120120
<groupId>org.xolstice.maven.plugins</groupId>
121121
<artifactId>protobuf-maven-plugin</artifactId>
122122
<version>0.6.1</version>
123+
<configuration>
124+
<protocArtifact>
125+
com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier}</protocArtifact>
126+
<pluginId>grpc-java</pluginId>
127+
<pluginArtifact>
128+
io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
129+
</configuration>
123130
<executions>
124131
<execution>
132+
<configuration>
133+
<pluginParameter>
134+
jakarta_omit
135+
</pluginParameter>
136+
</configuration>
125137
<goals>
126138
<goal>compile</goal>
127139
<goal>compile-custom</goal>
128140
</goals>
129141
</execution>
130142
</executions>
131-
<configuration>
132-
<protocArtifact>
133-
com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier}</protocArtifact>
134-
<pluginId>grpc-java</pluginId>
135-
<pluginArtifact>
136-
io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
137-
</configuration>
138143
</plugin>
139144
</plugins>
140145
</build>

spring-grpc-core/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@
4747
<groupId>io.grpc</groupId>
4848
<artifactId>grpc-stub</artifactId>
4949
</dependency>
50-
<dependency>
51-
<groupId>javax.annotation</groupId>
52-
<artifactId>javax.annotation-api</artifactId>
53-
<version>1.3.2</version>
54-
</dependency>
5550

5651
<dependency>
5752
<groupId>org.junit.jupiter</groupId>

0 commit comments

Comments
 (0)