Skip to content

Commit

Permalink
Require JDK 17 for build
Browse files Browse the repository at this point in the history
- reuse javaVersion property from parent
- property maven.compiler.release is set by parent for JDK 11+
- reuse checking of bytecode version from parent
  • Loading branch information
slawekjaranowski committed Dec 9, 2023
1 parent 4d098da commit c1ab31b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
uses: codehaus-plexus/.github/.github/workflows/maven.yml@master
with:
jdk-fast-fail-build: '21'
jdk-matrix: '["11", "17", "21"]'
jdk-matrix: '["17", "21"]'
jdk-distribution-matrix: '["zulu", "temurin", "microsoft", "liberica", "corretto"]'
os-matrix: '["ubuntu-latest","windows-latest", "macOS-latest"]'
maven_args: 'verify javadoc:javadoc -e -B -V -fae'
Expand Down
2 changes: 1 addition & 1 deletion plexus-compiler-its/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<properties>
<junit.version>4.13.2</junit.version>
<maven.compiler.release>11</maven.compiler.release>
<javaVersion>17</javaVersion>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

Expand Down
4 changes: 2 additions & 2 deletions plexus-compiler-its/src/main/it/simple-javac-fork/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.release>11</maven.compiler.release>
<plexus.compiler.version>@pom.version@</plexus.compiler.version>
<javaVersion>11</javaVersion>
<plexus.compiler.version>@project.version@</plexus.compiler.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion plexus-compilers/plexus-compiler-aspectj/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<description>AspectJ Compiler support for Plexus Compiler component.</description>

<properties>
<maven.compiler.release>11</maven.compiler.release>
<javaVersion>11</javaVersion>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion plexus-compilers/plexus-compiler-eclipse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<description>Eclipse Compiler support for Plexus Compiler component.</description>

<properties>
<maven.compiler.release>11</maven.compiler.release>
<javaVersion>17</javaVersion>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion plexus-compilers/plexus-compiler-javac-errorprone/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
See https://errorprone.info</description>

<properties>
<maven.compiler.release>11</maven.compiler.release>
<javaVersion>11</javaVersion>
</properties>

<dependencies>
Expand Down
28 changes: 3 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@

<properties>
<scm.url>scm:git:git@github.com:codehaus-plexus/plexus-compiler.git</scm.url>
<javaVersion>11</javaVersion>
<maven.compiler.release>8</maven.compiler.release>
<javaVersion>8</javaVersion>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<project.build.outputTimestamp>2022-12-17T17:23:49Z</project.build.outputTimestamp>
<jupiter.version>5.10.1</jupiter.version>
Expand Down Expand Up @@ -190,13 +189,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.4.1</version>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>1.7.0</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>enforce-java</id>
Expand All @@ -206,26 +198,12 @@
<configuration>
<rules>
<requireJavaVersion>
<version>[11,)</version>
<message>[ERROR] OLD JDK [${java.version}] in use. This projects requires JDK 11 or newer</message>
<version>[17,)</version>
<message>[ERROR] OLD JDK [${java.version}] in use. This projects requires JDK 17 or newer</message>
</requireJavaVersion>
</rules>
</configuration>
</execution>
<execution>
<id>enforce-bytecode-version</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<enforceBytecodeVersion>
<maxJdkVersion>${maven.compiler.release}</maxJdkVersion>
</enforceBytecodeVersion>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>

Expand Down

0 comments on commit c1ab31b

Please sign in to comment.