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

[JENKINS-54842] Define compiler configuration with Maven properties where possible and use Java 11 built-in functionality instead of Animal Sniffer #523

Merged
merged 5 commits into from
Mar 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 15 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.outputEncoding>UTF-8</project.build.outputEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<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>
<!-- Generate metadata for reflection on method parameters -->
<maven.compiler.parameters>true</maven.compiler.parameters>

<releaseProfiles />
<arguments />
<argLine>-Xms768M -Xmx768M -XX:+HeapDumpOnOutOfMemoryError -XX:+TieredCompilation -XX:TieredStopAtLevel=1</argLine>
Expand Down Expand Up @@ -110,9 +118,6 @@
<scmTag>HEAD</scmTag>
<!-- Where to put temporary files during test runs. -->
<surefireTempDir>${project.build.directory}/tmp</surefireTempDir>

<!-- Generate metadata for reflection on method parameters -->
<maven.compiler.parameters>true</maven.compiler.parameters>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -338,7 +343,6 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<source>8</source>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value is ${maven.compiler.source}, which we are setting above.

<quiet>true</quiet>
<links>
<link>https://javadoc.jenkins.io/</link>
Expand Down Expand Up @@ -695,20 +699,6 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<testSource>1.8</testSource>
<testTarget>1.8</testTarget>
<!--
Work around MCOMPILER-346.
TODO When MCOMPILER-346 is resolved, this should be deleted.
-->
<forceJavacCompilerUse>true</forceJavacCompilerUse>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
Expand Down Expand Up @@ -950,17 +940,13 @@
<activation>
<jdk>[1.9,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>8</release>
<testRelease>8</testRelease>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.release>8</maven.compiler.release>
<maven.compiler.testRelease>8</maven.compiler.testRelease>
<animal.sniffer.skip>true</animal.sniffer.skip>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically a change in behavior, but release serves the same purpose as Animal Sniffer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, almost. With A.S. you can use @IgnoreJRERequirements on a particular class/method. I do not recommend it (better to use reflection) and would not miss that capability being dropped.

<!-- 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>jenkins-release</id>
Expand Down