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

Add support for Java 14 #154

Merged
merged 1 commit into from
Jul 23, 2020
Merged
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
2 changes: 2 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ property or properties are set as needed:
* `java10.home`: this property must be set to the location of a Java 10 JDK installation
* `java11.home`: this property must be set to the location of a Java 11 JDK installation
* `java12.home`: this property must be set to the location of a Java 12 JDK installation
* `java13.home`: this property must be set to the location of a Java 13 JDK installation

In order to simplify development, it is recommended to project maintainers to set these
properties in your personal Maven `settings.xml` file.
Expand Down Expand Up @@ -201,5 +202,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