Skip to content

Commit

Permalink
Add support for Java 14
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd committed Jul 17, 2020
1 parent 8202e97 commit cebceed
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,6 @@ Note that this configuration causes the default `JAVA_HOME` environment to be se
|build-test-java10|Run tests for Java 10 when `java10.home` is set and JDK 11 or later is used.|<<mr-jar-testing>>
|build-test-java11|Run tests for Java 11 when `java11.home` is set and JDK 12 or later is used.|<<mr-jar-testing>>
|build-test-java12|Run tests for Java 12 when `java12.home` is set and JDK 13 or later is used.|<<mr-jar-testing>>
|build-test-java13|Run tests for Java 13 when `java13.home` is set and JDK 14 or later is used.|<<mr-jar-testing>>
|===

98 changes: 98 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,104 @@
</build>
</profile>


<!-- This profile is activated when Java 14 or later is used to test a project that supports Java 13 -->
<profile>
<id>java13-test</id>
<activation>
<jdk>[14,)</jdk>
<property>
<name>java13.home</name>
</property>
<file>
<exists>${basedir}/build-test-java13</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>java13-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<jvm>${java13.home}/bin/java</jvm>
<classesDirectory>${project.build.directory}/classes/META-INF/versions/13
</classesDirectory>
<additionalClasspathElements>
<additionalClasspathElement>
${project.build.directory}/classes/META-INF/versions/12
</additionalClasspathElement>
<additionalClasspathElement>
${project.build.directory}/classes/META-INF/versions/11
</additionalClasspathElement>
<additionalClasspathElement>
${project.build.directory}/classes/META-INF/versions/10
</additionalClasspathElement>
<additionalClasspathElement>
${project.build.directory}/classes/META-INF/versions/9
</additionalClasspathElement>
<additionalClasspathElement>${project.build.outputDirectory}
</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<!-- This profile is activated when Java 14 or later is used to build -->
<profile>
<id>java14-mr-build</id>
<activation>
<jdk>[14,)</jdk>
<file>
<exists>${basedir}/src/main/java14</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>compile-java14</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>14</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java14</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<!-- MR JAR support ends here-->

</profiles>
Expand Down

0 comments on commit cebceed

Please sign in to comment.