Skip to content

Commit

Permalink
Specify maven.compiler.release to fix issues with building with Java 11
Browse files Browse the repository at this point in the history
  • Loading branch information
lhotari committed Feb 7, 2024
1 parent d436e80 commit 902c750
Show file tree
Hide file tree
Showing 16 changed files with 96 additions and 117 deletions.
3 changes: 2 additions & 1 deletion bookkeeper-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<sourcepath>${src.dir}</sourcepath>
<!-- Avoid for missing javadoc comments to be marked as errors -->
<doclint>none</doclint>
<!--
<subpackages>org.apache.bookkeeper.common.annotation</subpackages>
-->
<groups>
<group>
<title>Bookkeeper Client</title>
Expand Down
3 changes: 2 additions & 1 deletion bookkeeper-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<sourcepath>${src.dir}</sourcepath>
<!-- Avoid for missing javadoc comments to be marked as errors -->
<doclint>none</doclint>
<!--
<subpackages>org.apache.bookkeeper.client:org.apache.bookkeeper.conf:org.apache.bookkeeper.feature</subpackages>
-->
<groups>
<group>
<title>Bookkeeper</title>
Expand Down
22 changes: 0 additions & 22 deletions circe-checksum/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<!-- Object.finalize() is deprecated at java 9 -->
<!-- <compilerArg>-Werror</compilerArg> -->
<compilerArg>-Xlint:deprecation</compilerArg>
<compilerArg>-Xlint:unchecked</compilerArg>
<!-- https://issues.apache.org/jira/browse/MCOMPILER-205 -->
<compilerArg>-Xpkginfo:always</compilerArg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>com.github.maven-nar</groupId>
Expand Down Expand Up @@ -154,17 +141,8 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<!-- Object.finalize() is deprecated at java 9 -->
<!-- <compilerArg>-Werror</compilerArg> -->
<compilerArg>-Xlint:deprecation</compilerArg>
<compilerArg>-Xlint:unchecked</compilerArg>
<!-- https://issues.apache.org/jira/browse/MCOMPILER-205 -->
<compilerArg>-Xpkginfo:always</compilerArg>
<!-- add -h flag to javac -->
<compilerArg>-h</compilerArg>
<compilerArg>${project.build.directory}/nar/javah-include</compilerArg>
Expand Down
21 changes: 0 additions & 21 deletions cpu-affinity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<!-- Object.finalize() is deprecated at java 9 -->
<!-- <compilerArg>-Werror</compilerArg> -->
<compilerArg>-Xlint:deprecation</compilerArg>
<compilerArg>-Xlint:unchecked</compilerArg>
<!-- https://issues.apache.org/jira/browse/MCOMPILER-205 -->
<compilerArg>-Xpkginfo:always</compilerArg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>com.github.maven-nar</groupId>
Expand Down Expand Up @@ -129,17 +117,8 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<!-- Object.finalize() is deprecated at java 9 -->
<!-- <compilerArg>-Werror</compilerArg> -->
<compilerArg>-Xlint:deprecation</compilerArg>
<compilerArg>-Xlint:unchecked</compilerArg>
<!-- https://issues.apache.org/jira/browse/MCOMPILER-205 -->
<compilerArg>-Xpkginfo:always</compilerArg>
<!-- add -h flag to javac -->
<compilerArg>-h</compilerArg>
<compilerArg>${project.build.directory}/nar/javah-include</compilerArg>
Expand Down
21 changes: 0 additions & 21 deletions native-io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<!-- Object.finalize() is deprecated at java 9 -->
<!-- <compilerArg>-Werror</compilerArg> -->
<compilerArg>-Xlint:deprecation</compilerArg>
<compilerArg>-Xlint:unchecked</compilerArg>
<!-- https://issues.apache.org/jira/browse/MCOMPILER-205 -->
<compilerArg>-Xpkginfo:always</compilerArg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>com.github.maven-nar</groupId>
Expand Down Expand Up @@ -120,17 +108,8 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgs>
<!-- Object.finalize() is deprecated at java 9 -->
<!-- <compilerArg>-Werror</compilerArg> -->
<compilerArg>-Xlint:deprecation</compilerArg>
<compilerArg>-Xlint:unchecked</compilerArg>
<!-- https://issues.apache.org/jira/browse/MCOMPILER-205 -->
<compilerArg>-Xpkginfo:always</compilerArg>
<!-- add -h flag to javac -->
<compilerArg>-h</compilerArg>
<compilerArg>${project.build.directory}/nar/javah-include</compilerArg>
Expand Down
90 changes: 66 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@
</developer>
</developers>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<javac.target>1.8</javac.target>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<testRetryCount>2</testRetryCount>
<src.dir>src/main/java</src.dir>
Expand All @@ -129,7 +130,7 @@
<curator.version>5.1.0</curator.version>
<dropwizard.version>4.1.12.1</dropwizard.version>
<etcd.version>0.5.11</etcd.version>
<freebuilder.version>2.7.0</freebuilder.version>
<freebuilder.version>2.8.0</freebuilder.version>
<google.code.version>3.0.2</google.code.version>
<google.errorprone.version>2.9.0</google.errorprone.version>
<grpc.version>1.56.0</grpc.version>
Expand All @@ -148,7 +149,7 @@
<junit5.version>5.10.1</junit5.version>
<assertj-core.version>3.25.2</assertj-core.version>
<libthrift.version>0.14.2</libthrift.version>
<lombok.version>1.18.26</lombok.version>
<lombok.version>1.18.30</lombok.version>
<log4j.version>2.18.0</log4j.version>
<lz4.version>1.3.0</lz4.version>
<mockito.version>3.12.4</mockito.version>
Expand Down Expand Up @@ -188,17 +189,17 @@
<license-maven-plugin.version>1.6</license-maven-plugin.version>
<lombok-maven-plugin.version>1.18.20.0</lombok-maven-plugin.version>
<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
<maven-assembly-plugin.version>3.1.0</maven-assembly-plugin.version>
<maven-checkstyle-plugin.version>3.2.1</maven-checkstyle-plugin.version>
<maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
<maven-assembly-plugin.version>3.6.0</maven-assembly-plugin.version>
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
<maven-clean-plugin.version>3.3.2</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
<maven-dependency-plugin.version>3.6.1</maven-dependency-plugin.version>
<maven-deploy-plugin.version>2.7</maven-deploy-plugin.version>
<maven-install-plugin.version>2.5.1</maven-install-plugin.version>
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
<maven-shade-plugin.version>3.2.0</maven-shade-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
<maven-install-plugin.version>3.1.1</maven-install-plugin.version>
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
<maven-shade-plugin.version>3.5.1</maven-shade-plugin.version>
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
<dependency-check-maven.version>8.0.2</dependency-check-maven.version>
<nar-maven-plugin.version>3.10.1</nar-maven-plugin.version>
Expand Down Expand Up @@ -248,7 +249,6 @@
<groupId>org.inferred</groupId>
<artifactId>freebuilder</artifactId>
<version>${freebuilder.version}</version>
<optional>true</optional>
</dependency>

<!-- logging dependencies -->
Expand Down Expand Up @@ -969,6 +969,16 @@
<artifactId>nar-maven-plugin</artifactId>
<version>${nar-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<!-- skip javadoc generation by default, use -Pdelombok to activate -->
<skip>true</skip>
<doclint>none</doclint>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand All @@ -981,17 +991,23 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${javac.target}</source>
<target>${javac.target}</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
<compilerArgs>
<compilerArg>-Xlint:deprecation</compilerArg>
<compilerArg>-Xlint:unchecked</compilerArg>
<!-- https://issues.apache.org/jira/browse/MCOMPILER-205 -->
<compilerArg>-Xpkginfo:always</compilerArg>
</compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
Expand All @@ -1014,12 +1030,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<notimestamp>true</notimestamp>
<!-- Prevent missing javadoc comments from being marked as errors -->
<doclint>none</doclint>
<!--
Cannot specify subpackages with maven.compiler.release because of bug https://bugs.openjdk.org/browse/JDK-8175277
<subpackages>org.apache.bookkeeper.client:org.apache.bookkeeper.client.api:org.apache.bookkeeper.common.annotation:org.apache.bookkeeper.conf:org.apache.bookkeeper.feature:org.apache.bookkeeper.stats</subpackages>
-->
<groups>
<group>
<title>Bookkeeper Client</title>
Expand Down Expand Up @@ -1254,6 +1270,14 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- activate javadoc generation -->
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand Down Expand Up @@ -1327,6 +1351,10 @@
<jdk>[11,)</jdk>
</activation>
<properties>
<!-- prevents silent NoSuchMethodErrors that happen at runtime on Java 8 -->
<!-- see https://github.com/apache/bookkeeper/issues/4202 -->
<maven.compiler.release>${maven.compiler.target}</maven.compiler.release>
<!-- required for running tests on Java 11+ -->
<test.additional.args>
--add-opens java.base/java.io=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
Expand All @@ -1349,6 +1377,20 @@
--add-opens java.xml/jdk.xml.internal=ALL-UNNAMED
</test.additional.args>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- for some reason, setting maven.compiler.release property alone doesn't work -->
<release>${maven.compiler.release}</release>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>apache-release</id>
Expand Down
3 changes: 2 additions & 1 deletion stats/bookkeeper-stats-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<sourcepath>${src.dir}</sourcepath>
<!-- Avoid for missing javadoc comments to be marked as errors -->
<doclint>none</doclint>
<!--
<subpackages>org.apache.bookkeeper.stats</subpackages>
-->
<groups>
<group>
<title>Bookkeeper Stats API</title>
Expand Down
4 changes: 0 additions & 4 deletions stream/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,5 @@
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</dependency>
<dependency>
<groupId>org.inferred</groupId>
<artifactId>freebuilder</artifactId>
</dependency>
</dependencies>
</project>
18 changes: 18 additions & 0 deletions stream/clients/java/base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
<artifactId>stream-storage-proto</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.inferred</groupId>
<artifactId>freebuilder</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.bookkeeper</groupId>
<artifactId>testtools</artifactId>
Expand All @@ -45,6 +50,19 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths combine.children="append">
<path>
<groupId>org.inferred</groupId>
<artifactId>freebuilder</artifactId>
<version>${freebuilder.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion stream/distributedlog/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
2 changes: 1 addition & 1 deletion stream/distributedlog/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Loading

0 comments on commit 902c750

Please sign in to comment.