Skip to content

Commit bb98aa9

Browse files
authored
Merge pull request #4685: [BEAM-2530] More fixes/upgrades for Java 9 compatibility
2 parents c8ca899 + 38ffebb commit bb98aa9

4 files changed

Lines changed: 110 additions & 5 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ ext.library = [
6666
bigdataoss_util: "com.google.cloud.bigdataoss:util:$google_cloud_bigdataoss_version",
6767
bigtable_client_core: "com.google.cloud.bigtable:bigtable-client-core:$bigtable_version",
6868
bigtable_protos: "com.google.cloud.bigtable:bigtable-protos:$bigtable_proto_version",
69-
byte_buddy: "net.bytebuddy:byte-buddy:1.6.8",
69+
byte_buddy: "net.bytebuddy:byte-buddy:1.7.10",
7070
commons_compress: "org.apache.commons:commons-compress:1.14",
7171
commons_csv: "org.apache.commons:commons-csv:1.4",
7272
commons_io_1x: "commons-io:commons-io:1.3.2",

build_rules.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ ext.applyJavaNature = {
218218
// Note that these plugins specifically use the compileOnly and testCompileOnly
219219
// configurations because they are never required to be shaded or become a
220220
// dependency of the output.
221-
def auto_value = "com.google.auto.value:auto-value:1.5.1"
221+
def auto_value = "com.google.auto.value:auto-value:1.5.3"
222222
def auto_service = "com.google.auto.service:auto-service:1.0-rc2"
223223

224224
compileOnly auto_value

pom.xml

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<datastore.proto.version>1.3.0</datastore.proto.version>
122122
<google-api-common.version>1.0.0-rc2</google-api-common.version>
123123
<google-auto-service.version>1.0-rc2</google-auto-service.version>
124-
<google-auto-value.version>1.5.1</google-auto-value.version>
124+
<google-auto-value.version>1.5.3</google-auto-value.version>
125125
<google-auth.version>0.7.1</google-auth.version>
126126
<google-clients.version>1.22.0</google-clients.version>
127127
<google-cloud-bigdataoss.version>1.4.5</google-cloud-bigdataoss.version>
@@ -162,12 +162,15 @@
162162
<apache-rat-plugin.version>0.12</apache-rat-plugin.version>
163163
<os-maven-plugin.version>1.5.0.Final</os-maven-plugin.version>
164164
<groovy-maven-plugin.version>2.0</groovy-maven-plugin.version>
165+
<license-maven-plugin.version>1.14</license-maven-plugin.version>
165166
<maven-surefire-plugin.version>2.20.1</maven-surefire-plugin.version>
166167
<maven-failsafe-plugin.version>2.20.1</maven-failsafe-plugin.version>
167168
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
168169
<maven-dependency-plugin.version>3.0.2</maven-dependency-plugin.version>
169170
<maven-enforcer-plugin.version>3.0.0-M1</maven-enforcer-plugin.version>
171+
<extra-enforcer-rules.version>1.0-beta-7</extra-enforcer-rules.version>
170172
<maven-exec-plugin.version>1.6.0</maven-exec-plugin.version>
173+
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
171174
<maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
172175
<maven-javadoc-plugin.version>3.0.0-M1</maven-javadoc-plugin.version>
173176
<maven-license-plugin.version>1.14</maven-license-plugin.version>
@@ -315,6 +318,7 @@
315318
<plugin>
316319
<groupId>org.apache.maven.plugins</groupId>
317320
<artifactId>maven-gpg-plugin</artifactId>
321+
<version>${maven-gpg-plugin.version}</version>
318322
<executions>
319323
<execution>
320324
<id>sign-release-artifacts</id>
@@ -413,6 +417,61 @@
413417
</build>
414418
</profile>
415419

420+
<profile>
421+
<id>java-9</id>
422+
<activation>
423+
<jdk>9</jdk>
424+
</activation>
425+
<properties>
426+
<!-- TODO Enable supported plugins once their issues are fixed -->
427+
<findbugs.skip>true</findbugs.skip>
428+
<maven.javadoc.skip>true</maven.javadoc.skip>
429+
<mdep.analyze.skip>true</mdep.analyze.skip>
430+
<!--
431+
maven surefire plugin automatically adds the java.se.ee module, we
432+
overwrite it to ensure we use the minimum set of modules.
433+
-->
434+
<beamSurefireArgline>--add-modules java.base</beamSurefireArgline>
435+
</properties>
436+
<build>
437+
<plugins>
438+
<plugin>
439+
<groupId>org.apache.maven.plugins</groupId>
440+
<artifactId>maven-compiler-plugin</artifactId>
441+
<configuration>
442+
<release>9</release>
443+
<showWarnings>true</showWarnings>
444+
</configuration>
445+
</plugin>
446+
<plugin>
447+
<groupId>org.apache.maven.plugins</groupId>
448+
<artifactId>maven-enforcer-plugin</artifactId>
449+
<executions>
450+
<execution>
451+
<id>enforce</id>
452+
<goals>
453+
<goal>enforce</goal>
454+
</goals>
455+
<configuration>
456+
<rules>
457+
<enforceBytecodeVersion>
458+
<maxJdkVersion>9</maxJdkVersion>
459+
</enforceBytecodeVersion>
460+
</rules>
461+
</configuration>
462+
</execution>
463+
</executions>
464+
</plugin>
465+
</plugins>
466+
</build>
467+
<dependencies>
468+
<dependency>
469+
<groupId>javax.annotation</groupId>
470+
<artifactId>javax.annotation-api</artifactId>
471+
<version>1.3.1</version>
472+
</dependency>
473+
</dependencies>
474+
</profile>
416475
</profiles>
417476

418477
<dependencyManagement>
@@ -1287,7 +1346,7 @@
12871346
<dependency>
12881347
<groupId>net.bytebuddy</groupId>
12891348
<artifactId>byte-buddy</artifactId>
1290-
<version>1.6.8</version>
1349+
<version>1.7.10</version>
12911350
</dependency>
12921351

12931352
<dependency>
@@ -2124,6 +2183,14 @@
21242183
<rules>
21252184
<enforceBytecodeVersion>
21262185
<maxJdkVersion>1.8</maxJdkVersion>
2186+
<!--
2187+
Multi release jars that are Java 8 compatible should pass,
2188+
but the extra-enforcer-plugin does not detect them
2189+
correctly so we should ignore them explicitly.
2190+
-->
2191+
<ignoreClasses>
2192+
<ignoreClass>module-info</ignoreClass>
2193+
</ignoreClasses>
21272194
<excludes>
21282195
<!--
21292196
Supplied by the user JDK and compiled with matching
@@ -2164,7 +2231,7 @@
21642231
<dependency>
21652232
<groupId>org.codehaus.mojo</groupId>
21662233
<artifactId>extra-enforcer-rules</artifactId>
2167-
<version>1.0-beta-6</version>
2234+
<version>${extra-enforcer-rules.version}</version>
21682235
</dependency>
21692236
</dependencies>
21702237
</plugin>

sdks/java/io/xml/pom.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,42 @@
110110
<scope>test</scope>
111111
</dependency>
112112
</dependencies>
113+
114+
<profiles>
115+
<profile>
116+
<id>java-9</id>
117+
<activation>
118+
<jdk>9</jdk>
119+
</activation>
120+
<dependencies>
121+
<!--
122+
These deps should be explicitly defined for Java >= 9 because they
123+
are not part of the defualt java.base module.
124+
-->
125+
<dependency>
126+
<groupId>javax.xml.bind</groupId>
127+
<artifactId>jaxb-api</artifactId>
128+
<version>2.3.0</version>
129+
</dependency>
130+
131+
<dependency>
132+
<groupId>com.sun.xml.bind</groupId>
133+
<artifactId>jaxb-impl</artifactId>
134+
<version>2.3.0</version>
135+
</dependency>
136+
137+
<dependency>
138+
<groupId>com.sun.xml.bind</groupId>
139+
<artifactId>jaxb-core</artifactId>
140+
<version>2.3.0</version>
141+
</dependency>
142+
143+
<dependency>
144+
<groupId>javax.activation</groupId>
145+
<artifactId>javax.activation-api</artifactId>
146+
<version>1.2.0</version>
147+
</dependency>
148+
</dependencies>
149+
</profile>
150+
</profiles>
113151
</project>

0 commit comments

Comments
 (0)