ARTEMIS-3296: get things building on Java 16 (and 17EA+21)

Updates parent pom, various plugins or deps, tidies up inconsistent versions
and consolidates to inherited version where possible, define properties for
some versions where not. Disables some problematic tests on JDK16+ for now.

Drops DS test dep back 1 version to remove a specific breakage affecting
multiple tests/modules, introduced after its upgrade in commit
9e70b26368.
This commit is contained in:
Robbie Gemmell 2021-05-17 09:18:19 +01:00 committed by clebertsuconic
parent fe361d3fae
commit 2e2cd1f073
7 changed files with 127 additions and 61 deletions

View File

@ -8,7 +8,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
java: [ 8, 11, 14 ] java: [ 8, 11, 16 ]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -31,7 +31,7 @@ jobs:
# By setting anything to org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED we are disabling libaio loading on the testsuite # By setting anything to org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED we are disabling libaio loading on the testsuite
- name: Build Main - name: Build Main
run: | run: |
mvn -Dorg.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED=AnythingNotNull -Djdk8-errorprone -Pfast-tests -Pextra-tests -Ptests-CI -Pjmh install mvn -Dorg.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED=AnythingNotNull -Derrorprone -Pfast-tests -Pextra-tests -Ptests-CI -Pjmh install
- name: Build Examples (JDK8 / -Prelease) - name: Build Examples (JDK8 / -Prelease)
if: matrix.java == '8' if: matrix.java == '8'

View File

@ -11,7 +11,7 @@ matrix:
env: env:
- EXAMPLES_PROFILE="noRun" - EXAMPLES_PROFILE="noRun"
- os: linux - os: linux
jdk: openjdk14 jdk: openjdk16
env: env:
- EXAMPLES_PROFILE="noRun" - EXAMPLES_PROFILE="noRun"
@ -24,7 +24,7 @@ before_install:
# By setting anything to org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED we are disabling libaio loading on the testsuite # By setting anything to org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED we are disabling libaio loading on the testsuite
script: script:
- set -e - set -e
- mvn -Dorg.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED=AnythingNotNull -Djdk8-errorprone -Pfast-tests -Pextra-tests -Ptests-CI -Pjmh -B install -q - mvn -Dorg.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED=AnythingNotNull -Derrorprone -Pfast-tests -Pextra-tests -Ptests-CI -Pjmh -B install -q
- cd examples - cd examples
- mvn install -P${EXAMPLES_PROFILE} -B -q - mvn install -P${EXAMPLES_PROFILE} -B -q

View File

@ -159,5 +159,23 @@
</dependency> </dependency>
</dependencies> </dependencies>
</profile> </profile>
<profile>
<!-- TODO: Changes so these tests can work? -->
<id>jdk16on</id>
<activation>
<jdk>[16,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles> </profiles>
</project> </project>

View File

@ -263,12 +263,13 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>${maven.assembly.plugin.version}</version>
<executions> <executions>
<execution> <execution>
<id>source</id> <id>source</id>
<configuration> <configuration>
<descriptors>
<descriptor>src/main/assembly/source-assembly.xml</descriptor> <descriptor>src/main/assembly/source-assembly.xml</descriptor>
</descriptors>
<tarLongFileMode>gnu</tarLongFileMode> <tarLongFileMode>gnu</tarLongFileMode>
</configuration> </configuration>
<phase>package</phase> <phase>package</phase>
@ -279,7 +280,9 @@
<execution> <execution>
<id>bin</id> <id>bin</id>
<configuration> <configuration>
<descriptors>
<descriptor>src/main/assembly/dep.xml</descriptor> <descriptor>src/main/assembly/dep.xml</descriptor>
</descriptors>
<tarLongFileMode>gnu</tarLongFileMode> <tarLongFileMode>gnu</tarLongFileMode>
</configuration> </configuration>
<phase>package</phase> <phase>package</phase>

109
pom.xml
View File

@ -25,7 +25,7 @@
<parent> <parent>
<groupId>org.apache</groupId> <groupId>org.apache</groupId>
<artifactId>apache</artifactId> <artifactId>apache</artifactId>
<version>18</version> <version>23</version>
<relativePath>org.apache:apache</relativePath> <relativePath>org.apache:apache</relativePath>
</parent> </parent>
@ -95,8 +95,10 @@
<jboss.logging.version>3.4.0.Final</jboss.logging.version> <jboss.logging.version>3.4.0.Final</jboss.logging.version>
<jetty.version>9.4.40.v20210413</jetty.version> <jetty.version>9.4.40.v20210413</jetty.version>
<jgroups.version>3.6.13.Final</jgroups.version> <jgroups.version>3.6.13.Final</jgroups.version>
<maven.assembly.plugin.version>2.4</maven.assembly.plugin.version> <errorprone.version>2.6.0</errorprone.version>
<mockito.version>3.3.3</mockito.version> <maven.enforcer.plugin.version>3.0.0-M3</maven.enforcer.plugin.version>
<maven.bundle.plugin.version>5.1.2</maven.bundle.plugin.version>
<mockito.version>3.9.0</mockito.version>
<jctools.version>2.1.2</jctools.version> <jctools.version>2.1.2</jctools.version>
<netty.version>4.1.63.Final</netty.version> <netty.version>4.1.63.Final</netty.version>
@ -130,11 +132,11 @@
<owb.version>1.7.0</owb.version> <owb.version>1.7.0</owb.version>
<arquillian.version>1.1.11.Final</arquillian.version> <arquillian.version>1.1.11.Final</arquillian.version>
<servicemix.json-1.1.spec.version>2.9.0</servicemix.json-1.1.spec.version> <servicemix.json-1.1.spec.version>2.9.0</servicemix.json-1.1.spec.version>
<version.org.jacoco>0.7.9</version.org.jacoco> <version.org.jacoco>0.8.6</version.org.jacoco>
<version.org.jacoco.plugin>0.7.9</version.org.jacoco.plugin> <version.org.jacoco.plugin>0.8.6</version.org.jacoco.plugin>
<version.maven.jar.plugin>2.4</version.maven.jar.plugin>
<version.micrometer>1.6.3</version.micrometer> <version.micrometer>1.6.3</version.micrometer>
<hamcrest.version>2.1</hamcrest.version> <hamcrest.version>2.1</hamcrest.version>
<junit.version>4.13.2</junit.version>
<surefire.version>2.22.2</surefire.version> <surefire.version>2.22.2</surefire.version>
<version.jaxb.runtime>2.3.3</version.jaxb.runtime> <version.jaxb.runtime>2.3.3</version.jaxb.runtime>
<paho.client.mqttv3.version>1.2.5</paho.client.mqttv3.version> <paho.client.mqttv3.version>1.2.5</paho.client.mqttv3.version>
@ -199,7 +201,7 @@
<skipStyleCheck>true</skipStyleCheck> <skipStyleCheck>true</skipStyleCheck>
<skipOWASP>true</skipOWASP> <skipOWASP>true</skipOWASP>
<directory-version>2.0.0.AM26</directory-version> <directory-version>2.0.0.AM25</directory-version>
<directory-jdbm2-version>2.0.0-M1</directory-jdbm2-version> <directory-jdbm2-version>2.0.0-M1</directory-jdbm2-version>
<netty-transport-native-epoll-classifier>linux-x86_64</netty-transport-native-epoll-classifier> <netty-transport-native-epoll-classifier>linux-x86_64</netty-transport-native-epoll-classifier>
@ -267,10 +269,9 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.11</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
<!-- License: CPL 1.0 --> <!-- License: CPL 1.0 -->
<!-- There are newer versions of the JUnit but they break our tests -->
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.easymock</groupId> <groupId>org.easymock</groupId>
@ -351,7 +352,7 @@
<dependency> <dependency>
<groupId>com.google.errorprone</groupId> <groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId> <artifactId>error_prone_core</artifactId>
<version>2.4.0</version> <version>${errorprone.version}</version>
<scope>provided</scope> <scope>provided</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
@ -907,7 +908,7 @@
<activation> <activation>
<jdk>1.8</jdk> <jdk>1.8</jdk>
<property> <property>
<name>jdk8-errorprone</name> <name>errorprone</name>
</property> </property>
</activation> </activation>
<build> <build>
@ -937,6 +938,12 @@
<maven.compiler.target>11</maven.compiler.target> <maven.compiler.target>11</maven.compiler.target>
<modular.jdk.surefire.arg>--add-modules java.sql,jdk.unsupported </modular.jdk.surefire.arg> <modular.jdk.surefire.arg>--add-modules java.sql,jdk.unsupported </modular.jdk.surefire.arg>
</properties> </properties>
</profile>
<profile>
<id>jdk11to15-errorprone</id>
<activation>
<jdk>[11,16)</jdk>
</activation>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
@ -954,6 +961,44 @@
</plugins> </plugins>
</build> </build>
</profile> </profile>
<profile>
<id>jdk16-errorprone</id>
<!-- This is very slow due to all the compiler forking required, so made it opt-in with -Derrorprone -->
<!-- TODO: MissingOverride check only warns in this profile for now, as JDK15+ added a toString method to CharSequence -->
<activation>
<jdk>16</jdk>
<property>
<name>errorprone</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<fork>true</fork>
<compilerArgs>
<arg>-Xdiags:verbose</arg>
<arg>--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne -Xep:MissingOverride:WARN -Xep:NonAtomicVolatileUpdate:ERROR -Xep:SynchronizeOnNonFinalField:ERROR -Xep:StaticQualifiedUsingExpression:ERROR -Xep:WaitNotInLoop:ERROR -XepExcludedPaths:.*/generated-sources/.*</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile> <profile>
<id>owasp</id> <id>owasp</id>
<properties> <properties>
@ -1029,7 +1074,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId> <artifactId>maven-enforcer-plugin</artifactId>
<version>1.4</version>
<executions> <executions>
<execution> <execution>
<id>enforce-java</id> <id>enforce-java</id>
@ -1391,7 +1435,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId> <artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version> <version>${maven.enforcer.plugin.version}</version>
<executions> <executions>
<execution> <execution>
<id>enforce-maven</id> <id>enforce-maven</id>
@ -1424,41 +1468,20 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration> <configuration>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-rar-plugin</artifactId> <artifactId>maven-rar-plugin</artifactId>
<version>2.3</version> <version>2.3</version>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${version.maven.jar.plugin}</version>
</plugin>
<plugin> <plugin>
<groupId>net.sf.maven-sar</groupId> <groupId>net.sf.maven-sar</groupId>
<artifactId>maven-sar-plugin</artifactId> <artifactId>maven-sar-plugin</artifactId>
<version>1.0</version> <version>1.0</version>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
@ -1469,11 +1492,6 @@
<artifactId>jetty-maven-plugin</artifactId> <artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version> <version>${jetty.version}</version>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin> <plugin>
<groupId>org.wildfly.extras.batavia</groupId> <groupId>org.wildfly.extras.batavia</groupId>
<artifactId>transformer-tools-mvn</artifactId> <artifactId>transformer-tools-mvn</artifactId>
@ -1484,7 +1502,6 @@
<inherited>true</inherited> <inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
@ -1513,7 +1530,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId> <artifactId>maven-install-plugin</artifactId>
<version>2.4</version>
<configuration> <configuration>
<createChecksum>true</createChecksum> <createChecksum>true</createChecksum>
</configuration> </configuration>
@ -1549,11 +1565,6 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
<!-- Many examples use it --> <!-- Many examples use it -->
<plugin> <plugin>
<groupId>org.apache.activemq</groupId> <groupId>org.apache.activemq</groupId>
@ -1572,7 +1583,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId> <artifactId>maven-enforcer-plugin</artifactId>
<version>1.4</version>
<executions> <executions>
<execution> <execution>
<id>enforce-java</id> <id>enforce-java</id>
@ -1659,7 +1669,6 @@
<plugin> <plugin>
<groupId>org.apache.rat</groupId> <groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId> <artifactId>apache-rat-plugin</artifactId>
<version>0.12</version>
<configuration> <configuration>
<reportFile>${activemq.basedir}/ratReport.txt</reportFile> <reportFile>${activemq.basedir}/ratReport.txt</reportFile>
<skip>${skipLicenseCheck}</skip> <skip>${skipLicenseCheck}</skip>
@ -1700,6 +1709,7 @@
<exclude>**/*.data</exclude> <exclude>**/*.data</exclude>
<exclude>**/*.bin</exclude> <exclude>**/*.bin</exclude>
<exclude>**/src/test/resources/keystore</exclude> <exclude>**/src/test/resources/keystore</exclude>
<exclude>**/src/test/java/org/apache/activemq/security/*.ts</exclude>
<exclude>**/*.log</exclude> <exclude>**/*.log</exclude>
<exclude>**/*.redo</exclude> <exclude>**/*.redo</exclude>
@ -1741,7 +1751,7 @@
<plugin> <plugin>
<groupId>org.apache.felix</groupId> <groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId> <artifactId>maven-bundle-plugin</artifactId>
<version>4.2.1</version> <version>${maven.bundle.plugin.version}</version>
<extensions>true</extensions> <extensions>true</extensions>
</plugin> </plugin>
<plugin> <plugin>
@ -1768,7 +1778,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions> <executions>
<execution> <execution>
<id>copy</id> <id>copy</id>

View File

@ -732,5 +732,25 @@
</snapshotRepository> </snapshotRepository>
</distributionManagement> </distributionManagement>
<profiles>
<profile>
<!-- TODO: Changes so these tests can work? -->
<id>jdk16on</id>
<activation>
<jdk>[16,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project> </project>

View File

@ -29,6 +29,7 @@
<properties> <properties>
<activemq.basedir>${project.basedir}/../..</activemq.basedir> <activemq.basedir>${project.basedir}/../..</activemq.basedir>
<its-surefire-extra-args/>
</properties> </properties>
<dependencies> <dependencies>
@ -481,7 +482,9 @@
<goal>single</goal> <goal>single</goal>
</goals> </goals>
<configuration> <configuration>
<descriptors>
<descriptor>src/test/resources/rest/bwlist-rest-test-asm.xml</descriptor> <descriptor>src/test/resources/rest/bwlist-rest-test-asm.xml</descriptor>
</descriptors>
<finalName>rest-test-bwlist</finalName> <finalName>rest-test-bwlist</finalName>
<appendAssemblyId>false</appendAssemblyId> <appendAssemblyId>false</appendAssemblyId>
<outputDirectory>target/test-classes/rest/</outputDirectory> <outputDirectory>target/test-classes/rest/</outputDirectory>
@ -494,7 +497,9 @@
<goal>single</goal> <goal>single</goal>
</goals> </goals>
<configuration> <configuration>
<descriptors>
<descriptor>src/test/resources/rest/rest-test-asm.xml</descriptor> <descriptor>src/test/resources/rest/rest-test-asm.xml</descriptor>
</descriptors>
<finalName>rest-test</finalName> <finalName>rest-test</finalName>
<appendAssemblyId>false</appendAssemblyId> <appendAssemblyId>false</appendAssemblyId>
<outputDirectory>target/test-classes/rest/</outputDirectory> <outputDirectory>target/test-classes/rest/</outputDirectory>
@ -523,7 +528,7 @@
<exclude>**/ReplicatedJMSFailoverTest.java</exclude> <exclude>**/ReplicatedJMSFailoverTest.java</exclude>
<exclude>org.apache.activemq/tests/util/*.java</exclude> <exclude>org.apache.activemq/tests/util/*.java</exclude>
</excludes> </excludes>
<argLine>-Djgroups.bind_addr=::1 ${activemq-surefire-argline} -Dorg.apache.activemq.SERIALIZABLE_PACKAGES="java.lang,javax.security,java.util,org.apache.activemq,org.fusesource.hawtbuf"</argLine> <argLine>-Djgroups.bind_addr=::1 ${activemq-surefire-argline} ${its-surefire-extra-args} -Dorg.apache.activemq.SERIALIZABLE_PACKAGES="java.lang,javax.security,java.util,org.apache.activemq,org.fusesource.hawtbuf"</argLine>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
@ -550,5 +555,16 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<profiles>
<profile>
<id>jdk16on</id>
<activation>
<jdk>[16,)</jdk>
</activation>
<properties>
<its-surefire-extra-args>--add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED</its-surefire-extra-args>
</properties>
</profile>
</profiles>
</project> </project>