From b2de650da0c100bfe82f6c4a0b9b8cddeec87b5d Mon Sep 17 00:00:00 2001 From: John Freeman Date: Sun, 21 Aug 2022 10:48:56 +0100 Subject: [PATCH] Added documentation for Java 17 to site For dealing with illegal access error. --- src/site/apt/usage.apt.vm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/site/apt/usage.apt.vm b/src/site/apt/usage.apt.vm index 1bc4784e..0f2cc5dc 100644 --- a/src/site/apt/usage.apt.vm +++ b/src/site/apt/usage.apt.vm @@ -34,6 +34,26 @@ Usage Some brief examples on how to use this plugin. +* Using Java 17 and later + + Java 17 is the first LTS release to enforce strong encapsulation. For + <<>> to work we need to add + <<<--add-opens java.base/java.lang=ALL-UNNAMED>>> to the JVM arguments. + + We recommend that you add a <<<.mvn/jvm.config>>> file (relative to the top + level project directory) to all of your projects using this plugin. The file + should have the following contents: + ++----------+ +--add-opens java.base/java.lang=ALL-UNNAMED ++----------+ + + We also recommend adding this to all of your projects using this plugin and + building with Java 11, as it'll suppress an illegal-access warning during the + build. + + For other options see: {{https://maven.apache.org/configure.html}} + * Formatting and checking for violations as part of the build Probably the most common use case is to want to both format and check your