Skip to content

Restore Java 8 runtime compatibility #278

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions plexus-compiler-its/src/main/it/error-prone-compiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@
</build>
</profile>
<profile>
<id>jdk16</id>
<id>jdk11</id>
<activation>
<jdk>[16,)</jdk>
<jdk>[11,)</jdk>
</activation>
<build>
<plugins>
Expand Down
3 changes: 2 additions & 1 deletion plexus-compilers/plexus-compiler-eclipse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
<version>3.32.0</version>
<!-- maximum version with bytecode 8 -->
<version>3.26.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Expand Down
23 changes: 14 additions & 9 deletions plexus-compilers/plexus-compiler-javac-errorprone/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,28 @@

<profiles>
<profile>
<id>16+</id>
<id>11+</id>
<activation>
<jdk>[16,)</jdk>
<jdk>[11,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
<!-- <argLine>-->
<!-- &#45;&#45;add-modules java.se-->
<!-- &#45;&#45;add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED-->
<!-- &#45;&#45;add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED-->
<!-- &#45;&#45;add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED-->
<!-- </argLine>-->
<argLine>
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ public class JavacErrorProneCompilerTest
extends AbstractCompilerTest
{

protected boolean java8() {
return System.getProperty( "java.version" ).startsWith( "1.8" );
}

@Override
protected String getRoleHint()
{
Expand All @@ -22,11 +18,13 @@ protected String getRoleHint()
@Override
protected int expectedWarnings()
{
if ( java8() ) {
String javaVersion = getJavaVersion();
if (javaVersion.startsWith("1.8")) {
return 1;
}
else
{
} else {
if (javaVersion.contains("18") || javaVersion.contains("19") || javaVersion.contains("20")) {
return 5;
}
return 2;
}
}
Expand Down
27 changes: 25 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<project.build.outputTimestamp>2022-12-17T17:23:49Z</project.build.outputTimestamp>
<jupiter.version>5.9.2</jupiter.version>
<aspectj.version>1.9.9.1</aspectj.version>
<!-- maximum version with bytecode 8 -->
<aspectj.version>1.9.7</aspectj.version>
<maven.version>3.2.5</maven.version>
<errorprone.version>2.18.0</errorprone.version>
<!-- maximum version with bytecode 8 -->
<errorprone.version>2.8.1</errorprone.version>
<trimStackTrace>false</trimStackTrace>
<preparationGoals>clean install</preparationGoals>
<maven.compiler.version>3.11.0</maven.compiler.version>
Expand Down Expand Up @@ -197,6 +199,13 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.3.0</version>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>enforce-java</id>
Expand All @@ -212,6 +221,20 @@
</rules>
</configuration>
</execution>
<execution>
<id>enforce-bytecode-version</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<enforceBytecodeVersion>
<maxJdkVersion>${maven.compiler.target}</maxJdkVersion>
</enforceBytecodeVersion>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>

Expand Down