Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Java 11 #209

Merged
merged 4 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ node('java') {

stage('Build') {
withEnv([
"JAVA_HOME=${tool 'jdk8'}",
"JAVA_HOME=${tool 'jdk11'}",
"PATH+MVN=${tool 'mvn'}/bin",
'PATH+JDK=$JAVA_HOME/bin',
]) {
Expand Down
86 changes: 6 additions & 80 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
<!-- By default only check remote repositories once per week -->
<maven.repository.update.freqency>interval:10080</maven.repository.update.freqency>

<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.testRelease>11</maven.compiler.testRelease>
<!-- Work around openjdk/jdk11u-dev#919. TODO When we upgrade to OpenJDK 11.0.16, this should be deleted. -->
<maven.compiler.forceJavacCompilerUse>true</maven.compiler.forceJavacCompilerUse>
<!-- Generate metadata for reflection on method parameters -->
<maven.compiler.parameters>true</maven.compiler.parameters>

Expand All @@ -112,7 +116,6 @@
<scmTag>HEAD</scmTag>

<!-- Define all plugin versions as properties so individual hierarchies can easily override -->
<animal-sniffer-plugin.version>1.21</animal-sniffer-plugin.version>
<apt-maven-plugin.version>1.0-alpha-5</apt-maven-plugin.version>
<axistools-maven-plugin.version>1.4</axistools-maven-plugin.version>
<buildnumber-maven-plugin.version>3.0.0</buildnumber-maven-plugin.version>
Expand Down Expand Up @@ -181,35 +184,6 @@
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-annotations</artifactId>
<version>${animal-sniffer-plugin.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java15</artifactId>
<version>1.0</version>
<type>signature</type>
</dependency>
<dependency>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java16</artifactId>
<version>1.1</version>
<type>signature</type>
</dependency>
<dependency>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java17</artifactId>
<version>1.0</version>
<type>signature</type>
</dependency>
<dependency>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java18</artifactId>
<version>1.0</version>
<type>signature</type>
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>test-annotations</artifactId>
Expand Down Expand Up @@ -757,7 +731,7 @@
</requirePluginVersions>
-->
<requireJavaVersion>
<version>[1.8.0,]</version>
<version>[11,]</version>
</requireJavaVersion>
<bannedDependencies>
<excludes>
Expand All @@ -777,7 +751,7 @@
</excludes>
</requireUpperBoundDeps>
<enforceBytecodeVersion>
<maxJdkVersion>1.8</maxJdkVersion>
<maxJdkVersion>11</maxJdkVersion>
<ignoredScopes>
<ignoredScope>test</ignoredScope>
</ignoredScopes>
Expand Down Expand Up @@ -811,60 +785,13 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>${animal-sniffer-plugin.version}</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java18</artifactId>
</signature>
</configuration>
<executions>
<execution>
<id>check</id>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jdk-8-and-below</id>
<activation>
<jdk>(,1.8]</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.testSource>1.8</maven.compiler.testSource>
<maven.compiler.testTarget>1.8</maven.compiler.testTarget>
</properties>
</profile>
<profile>
<id>jdk-9-and-above</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<properties>
<!-- When compiling with a Java 9+ compiler, we always rely on "release" in favor of "source" and "target", even when compiling to Java 8 bytecode. -->
<maven.compiler.release>8</maven.compiler.release>
<maven.compiler.testRelease>8</maven.compiler.testRelease>
<!-- "release" serves the same purpose as Animal Sniffer. -->
<animal.sniffer.skip>true</animal.sniffer.skip>
<!-- Work around openjdk/jdk11u-dev#919. TODO When we upgrade to OpenJDK 11.0.16, this should be deleted. -->
<maven.compiler.forceJavacCompilerUse>true</maven.compiler.forceJavacCompilerUse>
</properties>
</profile>
<profile>
<id>always-check-remote-repositories</id>
<properties>
Expand Down Expand Up @@ -1019,7 +946,6 @@
<spotbugs.skip>true</spotbugs.skip>
<enforcer.skip>true</enforcer.skip>
<access-modifier-checker.skip>true</access-modifier-checker.skip>
<animal.sniffer.skip>true</animal.sniffer.skip>
<invoker.skip>true</invoker.skip>
<spotless.check.skip>true</spotless.check.skip>
<checkstyle.skip>true</checkstyle.skip>
Expand Down