You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2016/09/28 20:29:18 UTC
svn commit: r1762705 - in /maven/plugins/trunk/maven-compiler-plugin/src:
it/MCOMPILER-275_separate-moduleinfo/pom.xml
site/apt/examples/module-info.apt.vm
Author: rfscholte
Date: Wed Sep 28 20:29:18 2016
New Revision: 1762705
URL: http://svn.apache.org/viewvc?rev=1762705&view=rev
Log:
[MCOMPILER-269] Support modulepath (Java9/Jigsaw)
verify bytecode version
improve pom-configuration
Modified:
maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-275_separate-moduleinfo/pom.xml
maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/module-info.apt.vm
Modified: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-275_separate-moduleinfo/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-275_separate-moduleinfo/pom.xml?rev=1762705&r1=1762704&r2=1762705&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-275_separate-moduleinfo/pom.xml (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-275_separate-moduleinfo/pom.xml Wed Sep 28 20:29:18 2016
@@ -51,28 +51,26 @@
<executions>
<execution>
<id>default-compile</id>
+ <!-- compile everything to ensure module-info contains right entries -->
<configuration>
- <excludes>
- <exclude>module-info.java</exclude>
- </excludes>
- <!-- ideally this would be 1.5, but with CI's it is hard to have a proper toolchains.xml in place -->
- <source>1.6</source>
- <target>1.6</target>
+ <jdkToolchain>
+ <version>9</version>
+ </jdkToolchain>
+ <release>9</release>
</configuration>
</execution>
<execution>
- <id>moduleinfo-compile</id>
+ <id>base-compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
- <includes>
- <include>module-info.java</include>
- </includes>
- <jdkToolchain>
- <version>9</version>
- </jdkToolchain>
- <release>9</release>
+ <excludes>
+ <exclude>module-info.java</exclude>
+ </excludes>
+ <!-- ideally this would be 1.5, but with CI's it is hard to have a proper toolchains.xml in place -->
+ <source>1.6</source>
+ <target>1.6</target>
</configuration>
</execution>
</executions>
Modified: maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/module-info.apt.vm
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/module-info.apt.vm?rev=1762705&r1=1762704&r2=1762705&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/module-info.apt.vm (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/module-info.apt.vm Wed Sep 28 20:29:18 2016
@@ -33,10 +33,11 @@ Older projects with module-info
<<<module-info.java>>> must be compiled with <<<release=9>>>, while the rest of the sources must be compiled with a
lower version of <<<source>>>/<<<target>>>.
- The preferred way to do this is by having 2 execution blocks are described below. JDK9 only supports compilations for
+ The preferred way to do this is by having 2 execution blocks are described below. JDK 9 only supports compilations for
Java 6 and above, so projects wanting to be compatible with Java 5 or below need to use two different JDKs. With
{{{/guides/mini/guide-using-toolchains.html}toolchains}} it is quite easy to achieve this. Be aware that you will
- need at least Maven 3.3.1 to specify a custom jdkToolchain in your plugin configuration.
+ need at least Maven 3.3.1 to specify a custom jdkToolchain in your plugin configuration. You could add a jdkToolchain
+ to do base-compile execution-block as well referring to JDK 5.
+-------
<project>
@@ -52,26 +53,24 @@ Older projects with module-info
<execution>
<id>default-compile</id>
<configuration>
- <excludes>
- <exclude>module-info.java</exclude>
- </excludes>
- <source>1.5</source>
- <target>1.5</target>
+ <!-- compile everything to ensure module-info contains right entries -->
+ <jdkToolchain>
+ <version>9</version>
+ </jdkToolchain>
+ <release>9</release>
</configuration>
</execution>
<execution>
- <id>moduleinfo-compile</id>
+ <id>base-compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
- <includes>
- <include>module-info.java</include>
- </includes>
- <jdkToolchain>
- <version>9</version>
- </jdkToolchain>
- <release>9</release>
+ <excludes>
+ <exclude>module-info.java</exclude>
+ </excludes>
+ <source>1.5</source>
+ <target>1.5</target>
</configuration>
</execution>
</executions>
@@ -85,7 +84,7 @@ Older projects with module-info
In case you want the project to be Java 6 compatible, the easiest to do this is to use Java 9 for both execution
blocks. You can use the maven-toolchain-plugin to specify the shared JDK (supported since Maven 2.0.9) or a custom
- jdkToolchain (supported since Maven 3.3.1) and refer to the JDK9 installation on your system. Or simply use Java 9
+ jdkToolchain (supported since Maven 3.3.1) and refer to the JDK 9 installation on your system. Or simply use Java 9
as the runtime for Maven by setting <<<JAVA_HOME=/path/to/jdk-9>>>.
+-------
@@ -102,27 +101,25 @@ Older projects with module-info
<execution>
<id>default-compile</id>
<configuration>
- <excludes>
- <exclude>module-info.java</exclude>
- </excludes>
- <release>6</release>
+ <!-- compile everything to ensure module-info contains right entries -->
+ <release>9</release>
</configuration>
</execution>
<execution>
- <id>moduleinfo-compile</id>
+ <id>base-compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
- <includes>
- <include>module-info.java</include>
- </includes>
- <release>9</release>
+ <excludes>
+ <exclude>module-info.java</exclude>
+ </excludes>
+ <release>6</release>
</configuration>
</execution>
</executions>
<configuration>
- <!-- Only required when JAVA_HOME isn't at least Java9 and when haven't configured the maven-toolchains-plugin -->
+ <!-- Only required when JAVA_HOME isn't at least Java 9 and when haven't configured the maven-toolchains-plugin -->
<jdkToolchain>
<version>9</version>
</jdkToolchain>