Skip to content

Commit

Permalink
Require JDK 17 for build (#327)
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 10, 2023
1 parent 3316707 commit 750d934
Show file tree
Hide file tree
Showing 16 changed files with 13 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
name: Build it
uses: codehaus-plexus/.github/.github/workflows/maven.yml@master
with:
matrix-exclude: '[ {"jdk": "8"} ]'
matrix-exclude: '[ {"jdk": "8"}, {"jdk": "11"} ]'
jdk-distribution-matrix: '["zulu", "temurin", "microsoft", "liberica", "corretto"]'
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
# specific language governing permissions and limitations
# under the License.

invoker.java.version = 11+
invoker.goals = clean compile
invoker.buildResult = failure
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
# specific language governing permissions and limitations
# under the License.

invoker.java.version = 1.8+
invoker.goals = clean test
#invoker.buildResult = failure
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

invoker.java.version = 1.8+
invoker.maven.version = 3.9.6+

# without-dummy profile is used to have compiler plugin do actual compilation in the second run
invoker.name.1 = Initial build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
# specific language governing permissions and limitations
# under the License.

invoker.java.version = 1.8+
invoker.goals = clean test-compile
invoker.buildResult = failure
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
# specific language governing permissions and limitations
# under the License.

invoker.java.version = 11+
invoker.goals = clean compile
#invoker.buildResult = failure
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
# specific language governing permissions and limitations
# under the License.

invoker.java.version = 1.8+
invoker.goals = clean test-compile
invoker.buildResult = failure
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.

invoker.java.version = 1.8+
invoker.maven.version = 3.9.6+

invoker.goals = clean test-compile
#invoker.buildResult = failure
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
# specific language governing permissions and limitations
# under the License.

invoker.java.version = 1.8+
invoker.goals = clean test-compile
#invoker.buildResult = failure
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
# specific language governing permissions and limitations
# under the License.

invoker.java.version = 1.8+
invoker.goals = clean test-compile
#invoker.buildResult = failure
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 750d934

Please sign in to comment.