You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2019/05/12 15:42:21 UTC

[maven-site] branch master updated: Added "Java 9 or later" section

This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-site.git


The following commit(s) were added to refs/heads/master by this push:
     new 6649aed  Added "Java 9 or later" section
     new 4a00025  Merge pull request #84 from behrangsa/patch-1
6649aed is described below

commit 6649aedd4fc1085c43bb39bedec35712e869ae22
Author: Behrang <18...@users.noreply.github.com>
AuthorDate: Sun May 12 18:37:33 2019 +1000

    Added "Java 9 or later" section
    
    Added "Java 9 or later" section to the "Maven in 5 Minutes" page.
---
 .../getting-started/maven-in-five-minutes.apt      | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/content/apt/guides/getting-started/maven-in-five-minutes.apt b/content/apt/guides/getting-started/maven-in-five-minutes.apt
index 5881637..fd894f8 100644
--- a/content/apt/guides/getting-started/maven-in-five-minutes.apt
+++ b/content/apt/guides/getting-started/maven-in-five-minutes.apt
@@ -202,6 +202,36 @@ java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
 Hello World!
 +-----+
 
+* Java 9 or later
+
+  By default your version of Maven might use an old version of the <<<maven-compiler-plugin>>> 
+  that is not compatible with Java 9 or later versions. To target Java 9 or later,
+  you should at least use version 3.6.0 of the <<<maven-compiler-plugin>>> and set the 
+  <<<maven.compiler.release>>> property to the Java release you are targetting  (e.g. 9, 10, 11, 12, etc.).
+
+  In the following example, we have configured our Maven project to use version 3.8.1 of <<<maven-compiler-plugin>>>
+  and target Java 11:
+
++-----+
+    <properties>
+        <maven.compiler.release>11</maven.compiler.release>
+    </properties>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <version>3.8.1</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
++-----+
+
+  To learn more about <<<javac>>>'s <<<--release>>> option, see {{{https://openjdk.java.net/jeps/247}JEP 247}}.
+
 * Running Maven Tools
 
 ** Maven Phases