Skip to content

Commit

Permalink
Add optional compile time only annotations-api dependency dropped in …
Browse files Browse the repository at this point in the history
…JDK11

Descriptions of the changes in this PR:

### Motivation

Java Annotations API has been dropped from JRE since JDK11. We should add it explicitly at compile time.
As we are using only the 'Generated' annotation, which has "source" retention when can add the dependency as 'optional'.
We are not re-distributing the JAR in binary packages.

### Changes

Add 'optional' dependency wherever it is needed (all GRPC artifacts for instance)

Master Issue: #1710




Author: Sijie Guo <guosijie@gmail.com>
Author: Enrico Olivelli <eolivelli@apache.org>

Reviewers: Ivan Kelly <ivank@apache.org>

This closes #1725 from eolivelli/fix/jdk11-add-annotations-api
  • Loading branch information
eolivelli committed Oct 2, 2018
1 parent 3446c2c commit 7da429e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Expand Up @@ -157,6 +157,7 @@
<shrinkwrap.version>3.0.1</shrinkwrap.version>
<slf4j.version>1.7.25</slf4j.version>
<spotbugs-annotations.version>3.1.1</spotbugs-annotations.version>
<javax-annotations-api.version>1.3.2</javax-annotations-api.version>
<testcontainers.version>1.8.3</testcontainers.version>
<twitter-server.version>1.29.0</twitter-server.version>
<vertx.version>3.4.1</vertx.version>
Expand Down Expand Up @@ -198,6 +199,11 @@
<artifactId>spotbugs-annotations</artifactId>
<version>${spotbugs-annotations.version}</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>${javax-annotations-api.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions stream/common/pom.xml
Expand Up @@ -41,6 +41,12 @@
<groupId>io.grpc</groupId>
<artifactId>grpc-all</artifactId>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<!-- this should not be bundled in binary distributions -->
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.bookkeeper.tests</groupId>
<artifactId>stream-storage-tests-common</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions stream/distributedlog/core/pom.xml
Expand Up @@ -54,6 +54,12 @@
<artifactId>bookkeeper-server</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<!-- this should not be bundled in binary distributions -->
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jmock</groupId>
<artifactId>jmock</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions stream/proto/pom.xml
Expand Up @@ -42,6 +42,12 @@
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<!-- this should not be bundled in binary distributions -->
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.bookkeeper.tests</groupId>
<artifactId>stream-storage-tests-common</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions stream/tests-common/pom.xml
Expand Up @@ -37,6 +37,12 @@
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<!-- this should not be bundled in binary distributions -->
<optional>true</optional>
</dependency>
</dependencies>

<build>
Expand Down

0 comments on commit 7da429e

Please sign in to comment.