You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2017/12/09 15:27:26 UTC

[maven-jlink-plugin] branch master created (now ab154af)

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

hboutemy pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/maven-jlink-plugin.git.


      at ab154af  added classical download.xml.vm

This branch includes the following new commits:

     new ca29934  First starting point of maven-jlink-plugin
     new 31f02fc  Continued maven-jlink-plugin
     new f3d4965  Allow own jdkToolchain use @jlinkArgs file to support long commandlines
     new 7c42480  o Updated to latest parent SNAPSHOT.
     new 8e41e1b  o Reverted last commit to reset to release version parent's.
     new e170669  Reformatted code.
     new 7727978  Updated jlink command line options to be in line with the most recent version of jlink from JDK9+172. Added the following options:  o --bind-services (bindServices)  o --disable-plugin (disablePlugin)  o --ignore-signing-information (ignoreSigningInformation)  o --no-header-files (noHeaderFiles)  o --no-man-pages (noManPages)  o --suggest-providers (suggestProviders)  o --verbose (verbose).
     new d4abcb6  o Removed resources plugin fomr life cycle definition cause   we can't offer supplemental files only via jlink o Usage of jar as well as jmod packaging for link. o Improved code o JLink plugin creates now a zip file of the resulting   image.
     new c81aff5  Added result image as archive to the project so an mvn install/deploy now works.
     new 63ca6a5  Migrate to get this running on JDK 9+178 and don't fail with IndexOutOfBounceException which is caused by commons-lang 2.4.
     new 144571b  Upgraded maven-archiver 3.2.0, plexus-archiver 3.5 Improved code.
     new 0591736  Updated description in pom file.
     new 7150636  Added basic site information. Addded parameter documentation. Added some unit tests for methods in AbstractJLinkMojo
     new 5ea7d26  cleaned up pom file.
     new 39161ac  Added deploySite.sh script for later deployment of the site. Enhanced the documentation added first example usage for maven-jlink-plugin to the site.
     new 20cf8a4  Fixed issue in usage page.
     new 51b2678  Changed location for resulting run time image Added more docs.
     new 4e16b30  Improved documentation of parameters
     new 4a64d47  Fixed docs.
     new 62a7e68  Fixed links.
     new 2c19e6d  Added plexus-java cause we need information about module-info.class to correctly create a Java Run Time Image. Using the dependencies only to handle modules.
     new 70e6281  o Changed ResolutionScope from COMPILE_PLUS_RUNTIME   to RUNTIME only. o Improved usage docs.
     new db77cd5  o Improved error message o Fixed command line options issue.
     new c7bfaa7  Upgraded to plexus-java version 0.9.3
     new 201673f  [MJLINK-1] Upgrade several plugins to get a working site generation  o Upgraded maven-invoker-plugin, maven-site-plugin    maven-javadoc-plugin also in reporting sections.
     new c8fa867  o Added integation test profile o Fixed some doc issues.
     new 178c289  Improved docs
     new 57e3cef  Commented out test which actually does not work.
     new d06ab29  [maven-release-plugin] prepare release maven-jlink-plugin-3.0.0-alpha-1
     new 8d7057a  [maven-release-plugin] prepare for next development iteration
     new e3e8956  [MJLINK-5] Parameter 'compression' is wrong. It is 'compress'  o Changed the wrong parameter for commandline from compression    into the correct on compress. Change the name of the parameter    accordingly.
     new 56c529d  [MJLINK-4] NPE on execution Use requiresDependencyResolution instead of requiresDependencyCollection (which only downloads the poms)
     new 238050c  Simplify code
     new f73f2de  [MJLINK-4] run this IT only when Java 9
     new c54c413  Added serveral integration tests. Upgraded maven-compiler-plugin to 3.7.0 Upgraded maven-invoker-plugin to 3.0.1 Enhanced maven-invoker-plugin configuration
     new ddc0ea2  Fixed missing copyright header.
     new 71ee9d9  use released plexus-java
     new ab154af  added classical download.xml.vm

The 38 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@maven.apache.org" <co...@maven.apache.org>'].

[maven-jlink-plugin] 37/38: use released plexus-java

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 71ee9d905aceeef7cab211ce132660b78b4f7801
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Sat Nov 11 04:44:16 2017 +0000

    use released plexus-java
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1814918 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index b4e07ff..fb8eb20 100644
--- a/pom.xml
+++ b/pom.xml
@@ -96,7 +96,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-java</artifactId>
-      <version>0.9.4-SNAPSHOT</version>
+      <version>0.9.4</version>
     </dependency>
     <dependency>
       <groupId>org.apache.commons</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 09/38: Added result image as archive to the project so an mvn install/deploy now works.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c81aff5d3cacaece4657dae8c3fed6b38ef8549f
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Mon Jun 26 17:43:43 2017 +0000

    Added result image as archive to the project so
    an mvn install/deploy now works.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1799963 13f79535-47bb-0310-9956-ffa450edef68
---
 .../META-INF/plexus/components.xml                 |  3 ---
 .../maven/plugins/jlink/AbstractJLinkMojo.java     |  1 +
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  | 28 +++++++++++++++-------
 3 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/src/main/filtered-resources/META-INF/plexus/components.xml b/src/main/filtered-resources/META-INF/plexus/components.xml
index 3a964b9..b98030d 100644
--- a/src/main/filtered-resources/META-INF/plexus/components.xml
+++ b/src/main/filtered-resources/META-INF/plexus/components.xml
@@ -31,7 +31,6 @@
       <configuration>
         <type>jlink</type>
         <extension>zip</extension>
-        <!-- Need to check the following? -->
         <includesDependencies>true</includesDependencies>
         <language>java</language>
         <addedToClasspath>false</addedToClasspath>
@@ -59,8 +58,6 @@
               <package>
                 org.apache.maven.plugins:maven-jlink-plugin:${project.version}:jlink
               </package>
-              <!-- What should be installed?
-              JRE image in zip/tar format? -->
               <install>
                 org.apache.maven.plugins:maven-install-plugin:2.5.2:install
               </install>
diff --git a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
index 271e71a..d4540c5 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
@@ -251,6 +251,7 @@ public abstract class AbstractJLinkMojo
 
         if ( tc == null )
         {
+            // TODO: Check if we should make the type configurable?
             tc = toolchainManager.getToolchainFromBuildContext( "jdk", session );
         }
 
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 3b0ba15..1a3e9ed 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -204,7 +204,7 @@ public class JLinkMojo
     private ArchiverManager manager;
 
     /**
-     * The kind of archive we should produce.
+     * The kind of archive we will produce.
      */
     @Parameter( defaultValue = "zip", required = true )
     private String archiveType;
@@ -246,7 +246,7 @@ public class JLinkMojo
 
         failIfParametersAreNotInTheirValidValueRanges();
 
-        deleteOutputDirectoryIfItAlreadyExists();
+        ifOutputDirectoryExistsDelteIt();
 
         List<Dependency> dependencies = getSession().getCurrentProject().getDependencies();
 
@@ -284,13 +284,25 @@ public class JLinkMojo
 
         File createZipArchiveFromImage = createZipArchiveFromImage( outputDirectory, outputDirectoryImage );
 
-        // Set main artifact.
+        if ( projectHasAlreadySetAnArtifact() )
+        {
+            throw new MojoExecutionException( "You have to use a classifier "
+                + "to attach supplemental artifacts to the project instead of replacing them." );
+        }
+
         getProject().getArtifact().setFile( createZipArchiveFromImage );
-        // artifact.setFile( createZipArchiveFromImage );
-        // getProject().setFile( createZipArchiveFromImage );
-        // packaging is something different than type..
-        // projectHelper.attachArtifact( getProject(), "image", "image", createZipArchiveFromImage );
+    }
 
+    private boolean projectHasAlreadySetAnArtifact()
+    {
+        if ( getProject().getArtifact().getFile() != null )
+        {
+            return getProject().getArtifact().getFile().isFile();
+        }
+        else
+        {
+            return false;
+        }
     }
 
     private File createZipArchiveFromImage( File outputDirectory, File outputDirectoryImage )
@@ -396,7 +408,7 @@ public class JLinkMojo
         // }
     }
 
-    private void deleteOutputDirectoryIfItAlreadyExists()
+    private void ifOutputDirectoryExistsDelteIt()
         throws MojoExecutionException
     {
         if ( outputDirectoryImage.exists() )

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 38/38: added classical download.xml.vm

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ab154af21f2f62a1f83e9e3618103c7a4fabc3ca
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Fri Nov 17 23:48:04 2017 +0000

    added classical download.xml.vm
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1815638 13f79535-47bb-0310-9956-ffa450edef68
---
 src/site/xdoc/download.xml.vm | 126 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 126 insertions(+)

diff --git a/src/site/xdoc/download.xml.vm b/src/site/xdoc/download.xml.vm
new file mode 100644
index 0000000..09d4f42
--- /dev/null
+++ b/src/site/xdoc/download.xml.vm
@@ -0,0 +1,126 @@
+<?xml version="1.0"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<document>
+  <properties>
+    <title>Download ${project.name} Source</title>
+  </properties>
+  <body>
+    <section name="Download ${project.name} ${project.version} Source">
+
+      <p>${project.name} ${project.version} is distributed in source format. Use a source archive if you intend to build
+      ${project.name} yourself. Otherwise, simply use the ready-made binary artifacts from central repository.</p>
+
+      <p>You will be prompted for a mirror - if the file is not found on yours, please be patient, as it may take 24
+      hours to reach all mirrors.<p/>
+
+      <p>In order to guard against corrupted downloads/installations, it is highly recommended to
+      <a href="http://www.apache.org/dev/release-signing#verifying-signature">verify the signature</a>
+      of the release bundles against the public <a href="http://www.apache.org/dist/maven/KEYS">KEYS</a> used by the Apache Maven
+      developers.</p>
+
+      <p>${project.name} is distributed under the <a href="http://www.apache.org/licenses/">Apache License, version 2.0</a>.</p>
+
+      <p></p>We <b>strongly</b> encourage our users to configure a Maven repository mirror closer to their location, please read <a href="/guides/mini/guide-mirror-settings.html">How to Use Mirrors for Repositories</a>.</p>
+
+      <a name="mirror"/>
+      <subsection name="Mirror">
+
+        <p>
+          [if-any logo]
+          <a href="[link]">
+            <img align="right" src="[logo]" border="0"
+                 alt="logo"/>
+          </a>
+          [end]
+          The currently selected mirror is
+          <b>[preferred]</b>.
+          If you encounter a problem with this mirror,
+          please select another mirror.
+          If all mirrors are failing, there are
+          <i>backup</i>
+          mirrors
+          (at the end of the mirrors list) that should be available.
+        </p>
+
+        <form action="[location]" method="get" id="SelectMirror">
+          Other mirrors:
+          <select name="Preferred">
+            [if-any http]
+            [for http]
+            <option value="[http]">[http]</option>
+            [end]
+            [end]
+            [if-any ftp]
+            [for ftp]
+            <option value="[ftp]">[ftp]</option>
+            [end]
+            [end]
+            [if-any backup]
+            [for backup]
+            <option value="[backup]">[backup] (backup)</option>
+            [end]
+            [end]
+          </select>
+          <input type="submit" value="Change"/>
+        </form>
+
+        <p>
+          You may also consult the
+          <a href="http://www.apache.org/mirrors/">complete list of
+            mirrors.</a>
+        </p>
+
+      </subsection>
+      
+      <subsection name="${project.name} ${project.version}">
+        
+      <p>This is the current stable version of ${project.name}.</p>
+        
+      <table>
+        <thead>
+          <tr>
+            <th></th>
+            <th>Link</th>
+            <th>Checksum</th>
+            <th>Signature</th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr>
+            <td>${project.name} ${project.version} (Source zip)</td>
+            <td><a href="[preferred]maven/plugins/${project.artifactId}-${project.version}-source-release.zip">maven/plugins/${project.artifactId}-${project.version}-source-release.zip</a></td>
+            <td><a href="http://www.apache.org/dist/maven/plugins/${project.artifactId}-${project.version}-source-release.zip.md5">maven/plugins/${project.artifactId}-${project.version}-source-release.zip.md5</a></td>
+            <td><a href="http://www.apache.org/dist/maven/plugins/${project.artifactId}-${project.version}-source-release.zip.asc">maven/plugins/${project.artifactId}-${project.version}-source-release.zip.asc</a></td>
+          </tr>
+        </tbody>
+      </table>
+      </subsection>
+
+      <subsection name="Previous Versions">
+        
+      <p>Older non-recommended releases can be found on our <a href="http://archive.apache.org/dist/maven/plugins/">archive site</a>.</p>
+
+      </subsection>
+    </section>
+  </body>
+</document>
+

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 35/38: Added serveral integration tests. Upgraded maven-compiler-plugin to 3.7.0 Upgraded maven-invoker-plugin to 3.0.1 Enhanced maven-invoker-plugin configuration

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c54c413df408243ecc9824abcf158afd48bfee4f
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Wed Nov 8 18:21:35 2017 +0000

    Added serveral integration tests.
    Upgraded maven-compiler-plugin to 3.7.0
    Upgraded maven-invoker-plugin to 3.0.1
    Enhanced maven-invoker-plugin configuration
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1814611 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  74 ++++++++++++++-------
 .../com.soebes.nine.jar-1.0-SNAPSHOT.jar           | Bin 0 -> 3704 bytes
 .../com.soebes.nine.jar-1.0-SNAPSHOT.pom           |   9 +++
 .../cli-options/bind-services/invoker.properties   |  18 +++++
 src/it/projects/cli-options/bind-services/pom.xml  |  66 ++++++++++++++++++
 .../bind-services/src/main/configs/config.test     |  21 ++++++
 .../cli-options/bind-services/verify.groovy        |  50 ++++++++++++++
 .../cli-options/compress-0/invoker.properties      |  18 +++++
 src/it/projects/cli-options/compress-0/pom.xml     |  66 ++++++++++++++++++
 .../compress-0/src/main/configs/config.test        |  21 ++++++
 .../projects/cli-options/compress-0/verify.groovy  |  50 ++++++++++++++
 .../cli-options/compress-1/invoker.properties      |  18 +++++
 src/it/projects/cli-options/compress-1/pom.xml     |  66 ++++++++++++++++++
 .../compress-1/src/main/configs/config.test        |  21 ++++++
 .../projects/cli-options/compress-1/verify.groovy  |  50 ++++++++++++++
 .../cli-options/compress-2/invoker.properties      |  18 +++++
 src/it/projects/cli-options/compress-2/pom.xml     |  66 ++++++++++++++++++
 .../compress-2/src/main/configs/config.test        |  21 ++++++
 .../projects/cli-options/compress-2/verify.groovy  |  50 ++++++++++++++
 .../cli-options/disable-plugin/invoker.properties  |  18 +++++
 src/it/projects/cli-options/disable-plugin/pom.xml |  66 ++++++++++++++++++
 .../disable-plugin/src/main/configs/config.test    |  21 ++++++
 .../cli-options/disable-plugin/verify.groovy       |  50 ++++++++++++++
 .../cli-options/endian-big/invoker.properties      |  18 +++++
 src/it/projects/cli-options/endian-big/pom.xml     |  66 ++++++++++++++++++
 .../endian-big/src/main/configs/config.test        |  21 ++++++
 .../projects/cli-options/endian-big/verify.groovy  |  50 ++++++++++++++
 .../projects/cli-options/endian/invoker.properties |  18 +++++
 src/it/projects/cli-options/endian/pom.xml         |  66 ++++++++++++++++++
 .../endian/src/main/configs/config.test            |  21 ++++++
 src/it/projects/cli-options/endian/verify.groovy   |  50 ++++++++++++++
 .../ignore-signing-information/invoker.properties  |  18 +++++
 .../cli-options/ignore-signing-information/pom.xml |  66 ++++++++++++++++++
 .../src/main/configs/config.test                   |  21 ++++++
 .../ignore-signing-information/verify.groovy       |  50 ++++++++++++++
 .../cli-options/no-header-files/invoker.properties |  18 +++++
 .../projects/cli-options/no-header-files/pom.xml   |  66 ++++++++++++++++++
 .../no-header-files/src/main/configs/config.test   |  21 ++++++
 .../cli-options/no-header-files/verify.groovy      |  50 ++++++++++++++
 .../cli-options/no-man-pages/invoker.properties    |  18 +++++
 src/it/projects/cli-options/no-man-pages/pom.xml   |  66 ++++++++++++++++++
 .../no-man-pages/src/main/configs/config.test      |  21 ++++++
 .../cli-options/no-man-pages/verify.groovy         |  50 ++++++++++++++
 .../cli-options/strip-debug/invoker.properties     |  18 +++++
 src/it/projects/cli-options/strip-debug/pom.xml    |  66 ++++++++++++++++++
 .../strip-debug/src/main/configs/config.test       |  21 ++++++
 .../projects/cli-options/strip-debug/verify.groovy |  50 ++++++++++++++
 .../suggest-providers/invoker.properties           |  18 +++++
 .../projects/cli-options/suggest-providers/pom.xml |  68 +++++++++++++++++++
 .../suggest-providers/src/main/configs/config.test |  21 ++++++
 .../cli-options/suggest-providers/verify.groovy    |  50 ++++++++++++++
 .../setup-jar-module-info/invoker.properties       |  18 +++++
 src/it/projects/setup-jar-module-info/pom.xml      |  53 +++++++++++++++
 .../src/main/java/module-info.java                 |  23 +++++++
 .../src/main/java/myproject/HelloWorld.java        |  36 ++++++++++
 src/it/projects/setup-jar/invoker.properties       |  18 +++++
 src/it/projects/setup-jar/pom.xml                  |  53 +++++++++++++++
 .../src/main/java/myproject/HelloWorld.java        |  36 ++++++++++
 .../META-INF/plexus/components.xml                 |  15 +++++
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  |   4 +-
 60 files changed, 2176 insertions(+), 25 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1cc90ba..b4e07ff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -96,7 +96,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-java</artifactId>
-      <version>0.9.3</version>
+      <version>0.9.4-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.commons</groupId>
@@ -129,8 +129,13 @@
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.7.0</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-invoker-plugin</artifactId>
-          <version>3.0.0</version>
+          <version>3.0.1</version>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
@@ -188,7 +193,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-invoker-plugin</artifactId>
-        <version>3.0.0</version>
+        <version>3.0.1</version>
       </plugin>
     </plugins>
   </reporting>
@@ -198,32 +203,55 @@
       <build>
         <plugins>
           <plugin>
-          <groupId>org.codehaus.mojo</groupId>
-          <artifactId>mrm-maven-plugin</artifactId>
-          <version>1.1.0</version>
-          <executions>
-            <execution>
-              <goals>
-                <goal>start</goal>
-                <goal>stop</goal>
-              </goals>
-            </execution>
-          </executions>
-          <configuration>
-            <repositories>
-              <mockRepo>
-                <source>src/it/mrm/repository</source>
-              </mockRepo>
-              <proxyRepo/>
-            </repositories>
-          </configuration>
-        </plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>mrm-maven-plugin</artifactId>
+            <version>1.1.0</version>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>start</goal>
+                  <goal>stop</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <propertyName>mrm.repository.url</propertyName>
+              <repositories>
+                <mockRepo>
+                  <source>src/it/mrm/repository</source>
+                </mockRepo>
+                <proxyRepo />
+              </repositories>
+            </configuration>
+          </plugin>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-invoker-plugin</artifactId>
             <configuration>
               <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+              <environmentVariables>
+                <!--
+                  ! Prevent reading the .mavenrc or maven_pre.bat on Windows 
+                  ! in integration tests.
+                -->
+                <MAVEN_SKIP_RC>1</MAVEN_SKIP_RC>
+              </environmentVariables>
+              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
               <projectsDirectory>src/it/projects</projectsDirectory>
+              <pomIncludes>
+                <pomInclude>**/pom.xml</pomInclude>
+                <!--
+                <pomInclude>cli-options/**/pom.xml</pomInclude>
+                -->
+              </pomIncludes>
+              <pomExcludes>
+                <!--
+                  ! Currently this Test does not work correctly either based
+                  ! on wrong implementation or my limited knowledge of suggest-providers
+                  ! and how the work.
+                -->
+                <pomExclude>cli-options/suggest-providers/pom.xml</pomExclude>
+              </pomExcludes>
               <settingsFile>src/it/mrm/settings.xml</settingsFile>
               <filterProperties>
                 <mrm.repository.url>${mrm.repository.url}</mrm.repository.url>
diff --git a/src/it/mrm/repository/localhost/com.soebes.nine.jar/1.0-SNAPSHOT/com.soebes.nine.jar-1.0-SNAPSHOT.jar b/src/it/mrm/repository/localhost/com.soebes.nine.jar/1.0-SNAPSHOT/com.soebes.nine.jar-1.0-SNAPSHOT.jar
new file mode 100644
index 0000000..19622d0
Binary files /dev/null and b/src/it/mrm/repository/localhost/com.soebes.nine.jar/1.0-SNAPSHOT/com.soebes.nine.jar-1.0-SNAPSHOT.jar differ
diff --git a/src/it/mrm/repository/localhost/com.soebes.nine.jar/1.0-SNAPSHOT/com.soebes.nine.jar-1.0-SNAPSHOT.pom b/src/it/mrm/repository/localhost/com.soebes.nine.jar/1.0-SNAPSHOT/com.soebes.nine.jar-1.0-SNAPSHOT.pom
new file mode 100644
index 0000000..353c833
--- /dev/null
+++ b/src/it/mrm/repository/localhost/com.soebes.nine.jar/1.0-SNAPSHOT/com.soebes.nine.jar-1.0-SNAPSHOT.pom
@@ -0,0 +1,9 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>localhost</groupId>
+  <artifactId>com.soebes.nine.jar</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+</project>
diff --git a/src/it/projects/cli-options/bind-services/invoker.properties b/src/it/projects/cli-options/bind-services/invoker.properties
new file mode 100644
index 0000000..8948d9b
--- /dev/null
+++ b/src/it/projects/cli-options/bind-services/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean package
diff --git a/src/it/projects/cli-options/bind-services/pom.xml b/src/it/projects/cli-options/bind-services/pom.xml
new file mode 100644
index 0000000..9fa2593
--- /dev/null
+++ b/src/it/projects/cli-options/bind-services/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-jlink-plugin-cli-options-bind-services</artifactId>
+  <version>99.0</version>
+  <packaging>jlink</packaging>
+  <name>Maven</name>
+  <url>http://maven.apache.org</url>
+  <description>Test JLink CLI Options --bind-services.</description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>localhost</groupId>
+      <artifactId>first-jar-module-info</artifactId>
+      <version>99.0</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.7.0</version>
+        <configuration>
+          <source>1.9</source>
+          <target>1.9</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+        <configuration>
+          <bindServices>true</bindServices>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/cli-options/bind-services/src/main/configs/config.test b/src/it/projects/cli-options/bind-services/src/main/configs/config.test
new file mode 100644
index 0000000..405149a
--- /dev/null
+++ b/src/it/projects/cli-options/bind-services/src/main/configs/config.test
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
diff --git a/src/it/projects/cli-options/bind-services/verify.groovy b/src/it/projects/cli-options/bind-services/verify.groovy
new file mode 100644
index 0000000..5a8353d
--- /dev/null
+++ b/src/it/projects/cli-options/bind-services/verify.groovy
@@ -0,0 +1,50 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or not a directory." );
+        return false;
+    }
+    File artifact = new File( target, "maven-jlink-plugin-cli-options-bind-services-99.0.zip" );
+    if ( !artifact.exists() || artifact.isDirectory() )
+    {
+        System.err.println( "maven-jlink-plugin-cli-options-bind-services-99.0.zip file is missing or is a directory." );
+        return false;
+    }
+
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;
diff --git a/src/it/projects/cli-options/compress-0/invoker.properties b/src/it/projects/cli-options/compress-0/invoker.properties
new file mode 100644
index 0000000..8948d9b
--- /dev/null
+++ b/src/it/projects/cli-options/compress-0/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean package
diff --git a/src/it/projects/cli-options/compress-0/pom.xml b/src/it/projects/cli-options/compress-0/pom.xml
new file mode 100644
index 0000000..b96fda3
--- /dev/null
+++ b/src/it/projects/cli-options/compress-0/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-jlink-plugin-cli-options-compress0</artifactId>
+  <version>99.0</version>
+  <packaging>jlink</packaging>
+  <name>Maven</name>
+  <url>http://maven.apache.org</url>
+  <description>Test JLink CLI Options --compress 0.</description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>localhost</groupId>
+      <artifactId>first-jar-module-info</artifactId>
+      <version>99.0</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.7.0</version>
+        <configuration>
+          <source>1.9</source>
+          <target>1.9</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+        <configuration>
+          <compress>0</compress>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/cli-options/compress-0/src/main/configs/config.test b/src/it/projects/cli-options/compress-0/src/main/configs/config.test
new file mode 100644
index 0000000..405149a
--- /dev/null
+++ b/src/it/projects/cli-options/compress-0/src/main/configs/config.test
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
diff --git a/src/it/projects/cli-options/compress-0/verify.groovy b/src/it/projects/cli-options/compress-0/verify.groovy
new file mode 100644
index 0000000..90861b7
--- /dev/null
+++ b/src/it/projects/cli-options/compress-0/verify.groovy
@@ -0,0 +1,50 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or not a directory." );
+        return false;
+    }
+    File artifact = new File( target, "maven-jlink-plugin-cli-options-compress0-99.0.zip" );
+    if ( !artifact.exists() || artifact.isDirectory() )
+    {
+        System.err.println( "maven-jlink-plugin-cli-options-compress0-99.0.zip file is missing or is a directory." );
+        return false;
+    }
+
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;
diff --git a/src/it/projects/cli-options/compress-1/invoker.properties b/src/it/projects/cli-options/compress-1/invoker.properties
new file mode 100644
index 0000000..8948d9b
--- /dev/null
+++ b/src/it/projects/cli-options/compress-1/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean package
diff --git a/src/it/projects/cli-options/compress-1/pom.xml b/src/it/projects/cli-options/compress-1/pom.xml
new file mode 100644
index 0000000..ac2bf5a
--- /dev/null
+++ b/src/it/projects/cli-options/compress-1/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-jlink-plugin-cli-options-compress1</artifactId>
+  <version>99.0</version>
+  <packaging>jlink</packaging>
+  <name>Maven</name>
+  <url>http://maven.apache.org</url>
+  <description>Test JLink CLI Options --compress 1.</description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>localhost</groupId>
+      <artifactId>first-jar-module-info</artifactId>
+      <version>99.0</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.7.0</version>
+        <configuration>
+          <source>1.9</source>
+          <target>1.9</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+        <configuration>
+          <compress>1</compress>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/cli-options/compress-1/src/main/configs/config.test b/src/it/projects/cli-options/compress-1/src/main/configs/config.test
new file mode 100644
index 0000000..405149a
--- /dev/null
+++ b/src/it/projects/cli-options/compress-1/src/main/configs/config.test
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
diff --git a/src/it/projects/cli-options/compress-1/verify.groovy b/src/it/projects/cli-options/compress-1/verify.groovy
new file mode 100644
index 0000000..d83211e
--- /dev/null
+++ b/src/it/projects/cli-options/compress-1/verify.groovy
@@ -0,0 +1,50 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or not a directory." );
+        return false;
+    }
+    File artifact = new File( target, "maven-jlink-plugin-cli-options-compress1-99.0.zip" );
+    if ( !artifact.exists() || artifact.isDirectory() )
+    {
+        System.err.println( "maven-jlink-plugin-cli-options-compress1-99.0.zip file is missing or is a directory." );
+        return false;
+    }
+
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;
diff --git a/src/it/projects/cli-options/compress-2/invoker.properties b/src/it/projects/cli-options/compress-2/invoker.properties
new file mode 100644
index 0000000..8948d9b
--- /dev/null
+++ b/src/it/projects/cli-options/compress-2/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean package
diff --git a/src/it/projects/cli-options/compress-2/pom.xml b/src/it/projects/cli-options/compress-2/pom.xml
new file mode 100644
index 0000000..35e3688
--- /dev/null
+++ b/src/it/projects/cli-options/compress-2/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-jlink-plugin-cli-options-compress2</artifactId>
+  <version>99.0</version>
+  <packaging>jlink</packaging>
+  <name>Maven</name>
+  <url>http://maven.apache.org</url>
+  <description>Test JLink CLI Options --compress 2.</description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>localhost</groupId>
+      <artifactId>first-jar-module-info</artifactId>
+      <version>99.0</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.7.0</version>
+        <configuration>
+          <source>1.9</source>
+          <target>1.9</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+        <configuration>
+          <compress>2</compress>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/cli-options/compress-2/src/main/configs/config.test b/src/it/projects/cli-options/compress-2/src/main/configs/config.test
new file mode 100644
index 0000000..405149a
--- /dev/null
+++ b/src/it/projects/cli-options/compress-2/src/main/configs/config.test
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
diff --git a/src/it/projects/cli-options/compress-2/verify.groovy b/src/it/projects/cli-options/compress-2/verify.groovy
new file mode 100644
index 0000000..1c2934b
--- /dev/null
+++ b/src/it/projects/cli-options/compress-2/verify.groovy
@@ -0,0 +1,50 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or not a directory." );
+        return false;
+    }
+    File artifact = new File( target, "maven-jlink-plugin-cli-options-compress2-99.0.zip" );
+    if ( !artifact.exists() || artifact.isDirectory() )
+    {
+        System.err.println( "maven-jlink-plugin-cli-options-compress2-99.0.zip file is missing or is a directory." );
+        return false;
+    }
+
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;
diff --git a/src/it/projects/cli-options/disable-plugin/invoker.properties b/src/it/projects/cli-options/disable-plugin/invoker.properties
new file mode 100644
index 0000000..8948d9b
--- /dev/null
+++ b/src/it/projects/cli-options/disable-plugin/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean package
diff --git a/src/it/projects/cli-options/disable-plugin/pom.xml b/src/it/projects/cli-options/disable-plugin/pom.xml
new file mode 100644
index 0000000..9b6dd5e
--- /dev/null
+++ b/src/it/projects/cli-options/disable-plugin/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-jlink-plugin-cli-options-disable-plugin</artifactId>
+  <version>99.0</version>
+  <packaging>jlink</packaging>
+  <name>Maven</name>
+  <url>http://maven.apache.org</url>
+  <description>Test JLink CLI Options --disable-plugin compress.</description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>localhost</groupId>
+      <artifactId>first-jar-module-info</artifactId>
+      <version>99.0</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.7.0</version>
+        <configuration>
+          <source>1.9</source>
+          <target>1.9</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+        <configuration>
+          <disablePlugin>compress</disablePlugin>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/cli-options/disable-plugin/src/main/configs/config.test b/src/it/projects/cli-options/disable-plugin/src/main/configs/config.test
new file mode 100644
index 0000000..405149a
--- /dev/null
+++ b/src/it/projects/cli-options/disable-plugin/src/main/configs/config.test
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
diff --git a/src/it/projects/cli-options/disable-plugin/verify.groovy b/src/it/projects/cli-options/disable-plugin/verify.groovy
new file mode 100644
index 0000000..838475d
--- /dev/null
+++ b/src/it/projects/cli-options/disable-plugin/verify.groovy
@@ -0,0 +1,50 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or not a directory." );
+        return false;
+    }
+    File artifact = new File( target, "maven-jlink-plugin-cli-options-disable-plugin-99.0.zip" );
+    if ( !artifact.exists() || artifact.isDirectory() )
+    {
+        System.err.println( "maven-jlink-plugin-cli-options-disable-plugin-99.0.zip file is missing or is a directory." );
+        return false;
+    }
+
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;
diff --git a/src/it/projects/cli-options/endian-big/invoker.properties b/src/it/projects/cli-options/endian-big/invoker.properties
new file mode 100644
index 0000000..8948d9b
--- /dev/null
+++ b/src/it/projects/cli-options/endian-big/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean package
diff --git a/src/it/projects/cli-options/endian-big/pom.xml b/src/it/projects/cli-options/endian-big/pom.xml
new file mode 100644
index 0000000..6d6f8ba
--- /dev/null
+++ b/src/it/projects/cli-options/endian-big/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-jlink-plugin-cli-options-endian-big</artifactId>
+  <version>99.0</version>
+  <packaging>jlink</packaging>
+  <name>Maven</name>
+  <url>http://maven.apache.org</url>
+  <description>Test JLink CLI Options --endian big.</description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>localhost</groupId>
+      <artifactId>first-jar-module-info</artifactId>
+      <version>99.0</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.7.0</version>
+        <configuration>
+          <source>1.9</source>
+          <target>1.9</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+        <configuration>
+          <endian>big</endian>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/cli-options/endian-big/src/main/configs/config.test b/src/it/projects/cli-options/endian-big/src/main/configs/config.test
new file mode 100644
index 0000000..405149a
--- /dev/null
+++ b/src/it/projects/cli-options/endian-big/src/main/configs/config.test
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
diff --git a/src/it/projects/cli-options/endian-big/verify.groovy b/src/it/projects/cli-options/endian-big/verify.groovy
new file mode 100644
index 0000000..c33d415
--- /dev/null
+++ b/src/it/projects/cli-options/endian-big/verify.groovy
@@ -0,0 +1,50 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or not a directory." );
+        return false;
+    }
+    File artifact = new File( target, "maven-jlink-plugin-cli-options-endian-big-99.0.zip" );
+    if ( !artifact.exists() || artifact.isDirectory() )
+    {
+        System.err.println( "maven-jlink-plugin-cli-options-endian-big-99.0.zip file is missing or is a directory." );
+        return false;
+    }
+
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;
diff --git a/src/it/projects/cli-options/endian/invoker.properties b/src/it/projects/cli-options/endian/invoker.properties
new file mode 100644
index 0000000..8948d9b
--- /dev/null
+++ b/src/it/projects/cli-options/endian/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean package
diff --git a/src/it/projects/cli-options/endian/pom.xml b/src/it/projects/cli-options/endian/pom.xml
new file mode 100644
index 0000000..9805377
--- /dev/null
+++ b/src/it/projects/cli-options/endian/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-jlink-plugin-cli-options-endian</artifactId>
+  <version>99.0</version>
+  <packaging>jlink</packaging>
+  <name>Maven</name>
+  <url>http://maven.apache.org</url>
+  <description>Test JLink CLI Options --endian little.</description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>localhost</groupId>
+      <artifactId>first-jar-module-info</artifactId>
+      <version>99.0</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.7.0</version>
+        <configuration>
+          <source>1.9</source>
+          <target>1.9</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+        <configuration>
+          <endian>little</endian>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/cli-options/endian/src/main/configs/config.test b/src/it/projects/cli-options/endian/src/main/configs/config.test
new file mode 100644
index 0000000..405149a
--- /dev/null
+++ b/src/it/projects/cli-options/endian/src/main/configs/config.test
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
diff --git a/src/it/projects/cli-options/endian/verify.groovy b/src/it/projects/cli-options/endian/verify.groovy
new file mode 100644
index 0000000..036422e
--- /dev/null
+++ b/src/it/projects/cli-options/endian/verify.groovy
@@ -0,0 +1,50 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or not a directory." );
+        return false;
+    }
+    File artifact = new File( target, "maven-jlink-plugin-cli-options-endian-99.0.zip" );
+    if ( !artifact.exists() || artifact.isDirectory() )
+    {
+        System.err.println( "maven-jlink-plugin-cli-options-endian-99.0.zip file is missing or is a directory." );
+        return false;
+    }
+
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;
diff --git a/src/it/projects/cli-options/ignore-signing-information/invoker.properties b/src/it/projects/cli-options/ignore-signing-information/invoker.properties
new file mode 100644
index 0000000..8948d9b
--- /dev/null
+++ b/src/it/projects/cli-options/ignore-signing-information/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean package
diff --git a/src/it/projects/cli-options/ignore-signing-information/pom.xml b/src/it/projects/cli-options/ignore-signing-information/pom.xml
new file mode 100644
index 0000000..252a54b
--- /dev/null
+++ b/src/it/projects/cli-options/ignore-signing-information/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-jlink-plugin-cli-options-ignore-signing-information</artifactId>
+  <version>99.0</version>
+  <packaging>jlink</packaging>
+  <name>Maven</name>
+  <url>http://maven.apache.org</url>
+  <description>Test JLink CLI Options --ignore-signing-information.</description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>localhost</groupId>
+      <artifactId>first-jar-module-info</artifactId>
+      <version>99.0</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.7.0</version>
+        <configuration>
+          <source>1.9</source>
+          <target>1.9</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+        <configuration>
+          <ignoreSigningInformation>true</ignoreSigningInformation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/cli-options/ignore-signing-information/src/main/configs/config.test b/src/it/projects/cli-options/ignore-signing-information/src/main/configs/config.test
new file mode 100644
index 0000000..405149a
--- /dev/null
+++ b/src/it/projects/cli-options/ignore-signing-information/src/main/configs/config.test
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
diff --git a/src/it/projects/cli-options/ignore-signing-information/verify.groovy b/src/it/projects/cli-options/ignore-signing-information/verify.groovy
new file mode 100644
index 0000000..92c47ea
--- /dev/null
+++ b/src/it/projects/cli-options/ignore-signing-information/verify.groovy
@@ -0,0 +1,50 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or not a directory." );
+        return false;
+    }
+    File artifact = new File( target, "maven-jlink-plugin-cli-options-ignore-signing-information-99.0.zip" );
+    if ( !artifact.exists() || artifact.isDirectory() )
+    {
+        System.err.println( "maven-jlink-plugin-cli-options-ignore-signing-information-99.0.zip file is missing or is a directory." );
+        return false;
+    }
+
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;
diff --git a/src/it/projects/cli-options/no-header-files/invoker.properties b/src/it/projects/cli-options/no-header-files/invoker.properties
new file mode 100644
index 0000000..8948d9b
--- /dev/null
+++ b/src/it/projects/cli-options/no-header-files/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean package
diff --git a/src/it/projects/cli-options/no-header-files/pom.xml b/src/it/projects/cli-options/no-header-files/pom.xml
new file mode 100644
index 0000000..4cda5ba
--- /dev/null
+++ b/src/it/projects/cli-options/no-header-files/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-jlink-plugin-cli-options-no-header-files</artifactId>
+  <version>99.0</version>
+  <packaging>jlink</packaging>
+  <name>Maven</name>
+  <url>http://maven.apache.org</url>
+  <description>Test JLink CLI Options --no-header-files.</description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>localhost</groupId>
+      <artifactId>first-jar-module-info</artifactId>
+      <version>99.0</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.7.0</version>
+        <configuration>
+          <source>1.9</source>
+          <target>1.9</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+        <configuration>
+          <noHeaderFiles>true</noHeaderFiles>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/cli-options/no-header-files/src/main/configs/config.test b/src/it/projects/cli-options/no-header-files/src/main/configs/config.test
new file mode 100644
index 0000000..405149a
--- /dev/null
+++ b/src/it/projects/cli-options/no-header-files/src/main/configs/config.test
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
diff --git a/src/it/projects/cli-options/no-header-files/verify.groovy b/src/it/projects/cli-options/no-header-files/verify.groovy
new file mode 100644
index 0000000..bb16189
--- /dev/null
+++ b/src/it/projects/cli-options/no-header-files/verify.groovy
@@ -0,0 +1,50 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or not a directory." );
+        return false;
+    }
+    File artifact = new File( target, "maven-jlink-plugin-cli-options-no-header-files-99.0.zip" );
+    if ( !artifact.exists() || artifact.isDirectory() )
+    {
+        System.err.println( "maven-jlink-plugin-cli-options-no-header-files-99.0.zip file is missing or is a directory." );
+        return false;
+    }
+
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;
diff --git a/src/it/projects/cli-options/no-man-pages/invoker.properties b/src/it/projects/cli-options/no-man-pages/invoker.properties
new file mode 100644
index 0000000..8948d9b
--- /dev/null
+++ b/src/it/projects/cli-options/no-man-pages/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean package
diff --git a/src/it/projects/cli-options/no-man-pages/pom.xml b/src/it/projects/cli-options/no-man-pages/pom.xml
new file mode 100644
index 0000000..c4ded3d
--- /dev/null
+++ b/src/it/projects/cli-options/no-man-pages/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-jlink-plugin-cli-options-no-man-pages</artifactId>
+  <version>99.0</version>
+  <packaging>jlink</packaging>
+  <name>Maven</name>
+  <url>http://maven.apache.org</url>
+  <description>Test JLink CLI Options --no-man-pages.</description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>localhost</groupId>
+      <artifactId>first-jar-module-info</artifactId>
+      <version>99.0</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.7.0</version>
+        <configuration>
+          <source>1.9</source>
+          <target>1.9</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+        <configuration>
+          <noManPages>true</noManPages>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/cli-options/no-man-pages/src/main/configs/config.test b/src/it/projects/cli-options/no-man-pages/src/main/configs/config.test
new file mode 100644
index 0000000..405149a
--- /dev/null
+++ b/src/it/projects/cli-options/no-man-pages/src/main/configs/config.test
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
diff --git a/src/it/projects/cli-options/no-man-pages/verify.groovy b/src/it/projects/cli-options/no-man-pages/verify.groovy
new file mode 100644
index 0000000..04685d8
--- /dev/null
+++ b/src/it/projects/cli-options/no-man-pages/verify.groovy
@@ -0,0 +1,50 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or not a directory." );
+        return false;
+    }
+    File artifact = new File( target, "maven-jlink-plugin-cli-options-no-man-pages-99.0.zip" );
+    if ( !artifact.exists() || artifact.isDirectory() )
+    {
+        System.err.println( "maven-jlink-plugin-cli-options-no-man-pages-99.0.zip file is missing or is a directory." );
+        return false;
+    }
+
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;
diff --git a/src/it/projects/cli-options/strip-debug/invoker.properties b/src/it/projects/cli-options/strip-debug/invoker.properties
new file mode 100644
index 0000000..8948d9b
--- /dev/null
+++ b/src/it/projects/cli-options/strip-debug/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean package
diff --git a/src/it/projects/cli-options/strip-debug/pom.xml b/src/it/projects/cli-options/strip-debug/pom.xml
new file mode 100644
index 0000000..5c83e57
--- /dev/null
+++ b/src/it/projects/cli-options/strip-debug/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-jlink-plugin-cli-options-strip-debug</artifactId>
+  <version>99.0</version>
+  <packaging>jlink</packaging>
+  <name>Maven</name>
+  <url>http://maven.apache.org</url>
+  <description>Test JLink CLI Options --strip-debug.</description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>localhost</groupId>
+      <artifactId>first-jar-module-info</artifactId>
+      <version>99.0</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.7.0</version>
+        <configuration>
+          <source>1.9</source>
+          <target>1.9</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+        <configuration>
+          <stripDebug>true</stripDebug>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/cli-options/strip-debug/src/main/configs/config.test b/src/it/projects/cli-options/strip-debug/src/main/configs/config.test
new file mode 100644
index 0000000..405149a
--- /dev/null
+++ b/src/it/projects/cli-options/strip-debug/src/main/configs/config.test
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
diff --git a/src/it/projects/cli-options/strip-debug/verify.groovy b/src/it/projects/cli-options/strip-debug/verify.groovy
new file mode 100644
index 0000000..0964348
--- /dev/null
+++ b/src/it/projects/cli-options/strip-debug/verify.groovy
@@ -0,0 +1,50 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or not a directory." );
+        return false;
+    }
+    File artifact = new File( target, "maven-jlink-plugin-cli-options-strip-debug-99.0.zip" );
+    if ( !artifact.exists() || artifact.isDirectory() )
+    {
+        System.err.println( "maven-jlink-plugin-cli-options-strip-debug-99.0.zip file is missing or is a directory." );
+        return false;
+    }
+
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;
diff --git a/src/it/projects/cli-options/suggest-providers/invoker.properties b/src/it/projects/cli-options/suggest-providers/invoker.properties
new file mode 100644
index 0000000..8948d9b
--- /dev/null
+++ b/src/it/projects/cli-options/suggest-providers/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean package
diff --git a/src/it/projects/cli-options/suggest-providers/pom.xml b/src/it/projects/cli-options/suggest-providers/pom.xml
new file mode 100644
index 0000000..3af8bfd
--- /dev/null
+++ b/src/it/projects/cli-options/suggest-providers/pom.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-jlink-plugin-cli-options-suggest-providers</artifactId>
+  <version>99.0</version>
+  <packaging>jlink</packaging>
+  <name>Maven</name>
+  <url>http://maven.apache.org</url>
+  <description>Test JLink CLI Options --suggest-providers xyz.</description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>localhost</groupId>
+      <artifactId>first-jar-module-info</artifactId>
+      <version>99.0</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.7.0</version>
+        <configuration>
+          <source>1.9</source>
+          <target>1.9</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+        <configuration>
+          <suggestProviders>
+            <suggestProvider>java.security.Provider</suggestProvider>
+          </suggestProviders>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/cli-options/suggest-providers/src/main/configs/config.test b/src/it/projects/cli-options/suggest-providers/src/main/configs/config.test
new file mode 100644
index 0000000..405149a
--- /dev/null
+++ b/src/it/projects/cli-options/suggest-providers/src/main/configs/config.test
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
diff --git a/src/it/projects/cli-options/suggest-providers/verify.groovy b/src/it/projects/cli-options/suggest-providers/verify.groovy
new file mode 100644
index 0000000..72e84d5
--- /dev/null
+++ b/src/it/projects/cli-options/suggest-providers/verify.groovy
@@ -0,0 +1,50 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or not a directory." );
+        return false;
+    }
+    File artifact = new File( target, "maven-jlink-plugin-cli-options-suggest-providers-99.0.zip" );
+    if ( !artifact.exists() || artifact.isDirectory() )
+    {
+        System.err.println( "maven-jlink-plugin-cli-options-suggest-providers-99.0.zip file is missing or is a directory." );
+        return false;
+    }
+
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;
diff --git a/src/it/projects/setup-jar-module-info/invoker.properties b/src/it/projects/setup-jar-module-info/invoker.properties
new file mode 100644
index 0000000..7651f3a
--- /dev/null
+++ b/src/it/projects/setup-jar-module-info/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean install
diff --git a/src/it/projects/setup-jar-module-info/pom.xml b/src/it/projects/setup-jar-module-info/pom.xml
new file mode 100644
index 0000000..ae65465
--- /dev/null
+++ b/src/it/projects/setup-jar-module-info/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>localhost</groupId>
+  <artifactId>first-jar-module-info</artifactId>
+  <version>99.0</version>
+  <name>Maven</name>
+  <description>
+      Test Project to prepare a jar file which contains
+      module-info.class file.
+  </description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.7.0</version>
+          <configuration>
+            <source>1.9</source>
+            <target>1.9</target>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>
diff --git a/src/it/projects/setup-jar-module-info/src/main/java/module-info.java b/src/it/projects/setup-jar-module-info/src/main/java/module-info.java
new file mode 100644
index 0000000..f84b259
--- /dev/null
+++ b/src/it/projects/setup-jar-module-info/src/main/java/module-info.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+module first.jar.module.info {
+  requires java.base;
+  exports myproject;
+}
diff --git a/src/it/projects/setup-jar-module-info/src/main/java/myproject/HelloWorld.java b/src/it/projects/setup-jar-module-info/src/main/java/myproject/HelloWorld.java
new file mode 100644
index 0000000..cadac6c
--- /dev/null
+++ b/src/it/projects/setup-jar-module-info/src/main/java/myproject/HelloWorld.java
@@ -0,0 +1,36 @@
+package myproject;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * The classic Hello World App.
+ */
+public class HelloWorld {
+
+  /**
+     * Main method.
+     *
+     * @param args Not used
+     */
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World from base jar file." );
+    } 
+}
\ No newline at end of file
diff --git a/src/it/projects/setup-jar/invoker.properties b/src/it/projects/setup-jar/invoker.properties
new file mode 100644
index 0000000..7651f3a
--- /dev/null
+++ b/src/it/projects/setup-jar/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+invoker.java.version = 1.9+
+invoker.goals = clean install
diff --git a/src/it/projects/setup-jar/pom.xml b/src/it/projects/setup-jar/pom.xml
new file mode 100644
index 0000000..0fbcdc0
--- /dev/null
+++ b/src/it/projects/setup-jar/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>localhost</groupId>
+  <artifactId>first-jar</artifactId>
+  <version>99.0</version>
+  <name>Maven</name>
+  <description>
+      Test Project to prepare a jar file which does not contain
+      module-info.class file.
+  </description>
+  <properties>
+    <maven.compiler.source>1.9</maven.compiler.source>
+    <maven.compiler.target>1.9</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.7.0</version>
+          <configuration>
+            <source>1.9</source>
+            <target>1.9</target>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>
diff --git a/src/it/projects/setup-jar/src/main/java/myproject/HelloWorld.java b/src/it/projects/setup-jar/src/main/java/myproject/HelloWorld.java
new file mode 100644
index 0000000..cadac6c
--- /dev/null
+++ b/src/it/projects/setup-jar/src/main/java/myproject/HelloWorld.java
@@ -0,0 +1,36 @@
+package myproject;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * The classic Hello World App.
+ */
+public class HelloWorld {
+
+  /**
+     * Main method.
+     *
+     * @param args Not used
+     */
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World from base jar file." );
+    } 
+}
\ No newline at end of file
diff --git a/src/main/filtered-resources/META-INF/plexus/components.xml b/src/main/filtered-resources/META-INF/plexus/components.xml
index b98030d..a0e6d0c 100644
--- a/src/main/filtered-resources/META-INF/plexus/components.xml
+++ b/src/main/filtered-resources/META-INF/plexus/components.xml
@@ -55,6 +55,21 @@
             <id>default</id>
             <!-- START SNIPPET: jlink-lifecycle -->
             <phases>
+              <process-resources>
+                org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources
+              </process-resources>
+              <compile>
+                org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile
+              </compile>
+              <process-test-resources>
+                org.apache.maven.plugins:maven-resources-plugin:3.0.2:testResources
+              </process-test-resources>
+              <test-compile>
+                org.apache.maven.plugins:maven-compiler-plugin:3.5.1:testCompile
+              </test-compile>
+              <test>
+                org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test
+              </test>
               <package>
                 org.apache.maven.plugins:maven-jlink-plugin:${project.version}:jlink
               </package>
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 2016e30..4261f1d 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -429,7 +429,7 @@ public class JLinkMojo
             throw new MojoFailureException( message );
         }
 
-        if ( endian != null && ( !"big".equals( endian ) || !"little".equals( endian ) ) )
+        if ( endian != null && ( !"big".equals( endian ) && !"little".equals( endian ) ) )
         {
             String message = "The given endian parameter " + endian
                 + " does not contain one of the following values: 'little' or 'big'.";
@@ -484,7 +484,7 @@ public class JLinkMojo
 
         if ( endian != null )
         {
-            argsFile.println( "--endians" );
+            argsFile.println( "--endian" );
             argsFile.println( endian );
         }
         if ( ignoreSigningInformation )

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 36/38: Fixed missing copyright header.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ddc0ea2f9c9279b4498bb459f2fff1bf1e50d197
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Wed Nov 8 18:26:11 2017 +0000

    Fixed missing copyright header.
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1814612 13f79535-47bb-0310-9956-ffa450edef68
---
 .../com.soebes.nine.jar-1.0-SNAPSHOT.pom            | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/it/mrm/repository/localhost/com.soebes.nine.jar/1.0-SNAPSHOT/com.soebes.nine.jar-1.0-SNAPSHOT.pom b/src/it/mrm/repository/localhost/com.soebes.nine.jar/1.0-SNAPSHOT/com.soebes.nine.jar-1.0-SNAPSHOT.pom
index 353c833..7d15b89 100644
--- a/src/it/mrm/repository/localhost/com.soebes.nine.jar/1.0-SNAPSHOT/com.soebes.nine.jar-1.0-SNAPSHOT.pom
+++ b/src/it/mrm/repository/localhost/com.soebes.nine.jar/1.0-SNAPSHOT/com.soebes.nine.jar-1.0-SNAPSHOT.pom
@@ -1,3 +1,24 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
   <modelVersion>4.0.0</modelVersion>

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 02/38: Continued maven-jlink-plugin

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 31f02fc5012edee09f9371f329aca204e3e62978
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sun Oct 9 12:03:21 2016 +0000

    Continued maven-jlink-plugin
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1763964 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  56 +++++++
 .../META-INF/plexus/components.xml                 |  77 ++++++++++
 .../maven/plugins/jlink/AbstractJLinkMojo.java     |   2 +-
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  | 167 ++++++++++++++++++---
 4 files changed, 283 insertions(+), 19 deletions(-)

diff --git a/pom.xml b/pom.xml
index d2dc19c..0d1b72f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,6 +61,8 @@
 
   <properties>
     <mavenVersion>3.0</mavenVersion>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
   </properties>
 
   <dependencies>
@@ -85,5 +87,59 @@
       <artifactId>commons-lang</artifactId>
       <version>2.4</version>
     </dependency>
+<!--     <dependency> -->
+<!--       <groupId>org.mockito</groupId> -->
+<!--       <artifactId>mockito-core</artifactId> -->
+<!--       <version>1.9.5</version> -->
+<!--       <scope>test</scope> -->
+<!--     </dependency> -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.12</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>io.takari.maven.plugins</groupId>
+      <artifactId>takari-plugin-testing</artifactId>
+      <version>2.9.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency> <!-- used by takari-plugin-testing, don't give it compile scope! -->
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-compat</artifactId>
+      <version>${mavenVersion}</version>
+      <scope>test</scope>
+    </dependency>
+
   </dependencies>
+
+  <build>
+    <resources>
+      <resource>
+        <directory>src/main/filtered-resources</directory>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
+  </build>
+<!--   <build> -->
+<!--     <plugins> -->
+<!--       <plugin> -->
+<!--         <groupId>io.takari.maven.plugins</groupId> -->
+<!--         <artifactId>takari-lifecycle-plugin</artifactId> -->
+<!--         <version>1.12.1</version> -->
+<!--         <extensions>true</extensions> -->
+<!--         <executions> -->
+<!--           <execution> -->
+<!--             <id>testProperties</id> -->
+<!--             <phase>process-test-resources</phase> -->
+<!--             <goals> -->
+<!--               <goal>testProperties</goal> -->
+<!--             </goals> -->
+<!--           </execution> -->
+<!--         </executions> -->
+<!--       </plugin> -->
+<!--     </plugins> -->
+<!--   </build> -->
 </project>
diff --git a/src/main/filtered-resources/META-INF/plexus/components.xml b/src/main/filtered-resources/META-INF/plexus/components.xml
new file mode 100644
index 0000000..b1554b1
--- /dev/null
+++ b/src/main/filtered-resources/META-INF/plexus/components.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<component-set>
+  <components>
+    <!--
+     | JLINK
+     |-->
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>jlink</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <type>jlink</type>
+        <includesDependencies>true</includesDependencies>
+        <language>java</language>
+        <addedToClasspath>false</addedToClasspath>
+      </configuration>
+    </component>
+
+    <!--
+      | Defining the phases with their appropriate plugins
+      ! and versions which will be executed during the 'default'
+      ! life cycle.
+    -->
+    <!--
+     | JLINK
+     |-->
+    <component>
+      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
+      <role-hint>jlink</role-hint>
+      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
+      <configuration>
+        <lifecycles>
+          <lifecycle>
+            <id>default</id>
+            <!-- START SNIPPET: jlink-lifecycle -->
+            <phases>
+              <process-resources>
+                org.apache.maven.plugins:maven-resources-plugin:3.0.1:resources
+              </process-resources>
+              <package>
+                org.apache.maven.plugins:maven-jlink-plugin:${project.version}:jlink
+              </package>
+              <install>
+                org.apache.maven.plugins:maven-install-plugin:2.5.2:install
+              </install>
+              <deploy>
+                org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
+              </deploy>
+            </phases>
+            <!-- END SNIPPET: jlink-lifecycle -->
+          </lifecycle>
+        </lifecycles>
+      </configuration>
+    </component>
+
+  </components>
+</component-set>
diff --git a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
index bda6813..4a90d1f 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
@@ -167,7 +167,7 @@ public abstract class AbstractJLinkMojo
                 if ( StringUtils.isNotEmpty( output ) )
                 {
                     //Reconsider to use WARN / ERROR ?
-                    getLog().info( output );
+                    getLog().error( output );
                 }
 
                 StringBuilder msg = new StringBuilder( "\nExit code: " );
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 27eb088..8369cb9 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -1,5 +1,24 @@
 package org.apache.maven.plugins.jlink;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 import java.io.File;
 
 /*
@@ -22,14 +41,18 @@ import java.io.File;
  */
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.commons.lang.SystemUtils;
+import org.apache.maven.model.Dependency;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
@@ -58,7 +81,9 @@ import org.codehaus.plexus.util.cli.Commandline;
 // TODO: Think if ResultionScope is needed here? May be we need to reconsider package phase?
 // May be it would be wise to put into PREPARE-PACKAGE and the generation of the final jimage in the package phase?
 // Furthermore It could make sense so we can change the conf files if needed...
-@Mojo( name = "jlink", requiresDependencyResolution = ResolutionScope.COMPILE, defaultPhase = LifecyclePhase.PACKAGE )
+// CHECKSTYLE_OFF: LineLength
+@Mojo( name = "jlink", requiresDependencyResolution = ResolutionScope.COMPILE, defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true )
+// CHECKSTYLE_ON: LineLength
 public class JLinkMojo
     extends AbstractJLinkMojo
 {
@@ -75,10 +100,11 @@ public class JLinkMojo
     private Integer compression;
 
     /**
-     * Define the modulepath for the <code>JLink</code> call. <code>--module-path &lt;modulepath&gt;</code>
+     * Define the modulepath for the <code>JLink</code> call. <code>--module-path &lt;modulepath&gt;</code> TODO: The
+     * default should be the jmods folder of the JDK...
      */
-    @Parameter( required = true )
-    private File modulePath;
+    @Parameter
+    private List<String> modulePaths;
 
     /**
      * Limit the univers of observable modules. <code>--limit-modules &lt;mod&gt;[,&lt;mod&gt;...]</code>
@@ -99,12 +125,11 @@ public class JLinkMojo
     private File pluginModulePath;
 
     /**
-     * <code>--output &lt;path&gt;</code> 
+     * <code>--output &lt;path&gt;</code>
      * </p>
-     * TODO: Think about the default value? I'm not sure if something different would
-     * be better?
+     * TODO: Think about the default value? I'm not sure if something different would be better?
      */
-    @Parameter( defaultValue = "${project.build.output}/link-result" )
+    @Parameter( defaultValue = "${project.build.directory}/link-result" )
     private File outputDirectory;
 
     /**
@@ -119,27 +144,98 @@ public class JLinkMojo
         throws MojoExecutionException, MojoFailureException
     {
 
-        failIfParametersAreNotInTheirValidValueRanges();
-
-        String jLinkExecutable;
+        String jLinkExec;
         try
         {
-            jLinkExecutable = getJLinkExecutable();
+            jLinkExec = getJLinkExecutable();
         }
         catch ( IOException e )
         {
             throw new MojoFailureException( "Unable to find jlink command: " + e.getMessage(), e );
         }
 
+        getLog().info( "Toolchain in maven-jlink-plugin: jlink [ " + jLinkExec + " ]" );
+
+        // TODO: Find a more better and cleaner way?
+        File jLinkExecuteable = new File( jLinkExec );
+
+        // Really Hacky...
+        File jLinkParent = jLinkExecuteable.getParentFile().getParentFile();
+        File jmodsFolder = new File( jLinkParent, "jmods" );
+
+        getLog().debug( " Parent: " + jLinkParent.getAbsolutePath() );
+        getLog().debug( " jmodsFolder: " + jmodsFolder.getAbsolutePath() );
+
+        failIfParametersAreNotInTheirValidValueRanges();
+
         deleteOutputDirectoryIfItAlreadyExists();
 
+        List<MavenProject> sortedProjects = getSession().getProjectDependencyGraph().getSortedProjects();
+        for ( MavenProject mavenProject : sortedProjects )
+        {
+            getLog().info( "MavenProject: " + mavenProject.getBasedir() );
+        }
+
+        List<Dependency> dependencies = getSession().getCurrentProject().getDependencies();
+
+        List<MavenProject> modulesToAdd = new ArrayList<>();
+        for ( Dependency dependency : dependencies )
+        {
+            if ( "jmod".equals( dependency.getType() ) )
+            {
+                MavenProject mp = findDependencyInProjects( dependency );
+                // TODO: What about module name != artifactId which has been
+                // defined in module-info.java file!
+                modulesToAdd.add( mp );
+            }
+        }
+
+        if ( addModules == null )
+        {
+            addModules = new ArrayList<>();
+        }
+        for ( MavenProject mavenProject : modulesToAdd )
+        {
+            addModules.add( mavenProject.getArtifactId() );
+        }
+
+        if ( modulePaths == null )
+        {
+            modulePaths = new ArrayList<>();
+        }
+
+        // JDK mods folder
+        modulePaths.add( jmodsFolder.getAbsolutePath() );
+
+        for ( MavenProject mavenProject : modulesToAdd )
+        {
+            File output = new File( mavenProject.getBuild().getDirectory(), "jmods" );
+            modulePaths.add( output.getAbsolutePath() );
+        }
+
         // Synopsis
         // Usage: jlink <options> --module-path <modulepath> --add-modules <mods> --output <path>
         Commandline cmd = createJLinkCommandLine();
-        cmd.setExecutable( jLinkExecutable );
+        cmd.setExecutable( jLinkExec );
 
         executeCommand( cmd, outputDirectory );
-        
+
+    }
+
+    private MavenProject findDependencyInProjects( Dependency dep )
+    {
+        List<MavenProject> sortedProjects = getSession().getProjectDependencyGraph().getSortedProjects();
+        MavenProject result = null;
+        for ( MavenProject mavenProject : sortedProjects )
+        {
+            if ( dep.getGroupId().equals( mavenProject.getGroupId() )
+                && dep.getArtifactId().equals( mavenProject.getArtifactId() )
+                && dep.getVersion().equals( mavenProject.getVersion() ) )
+            {
+                result = mavenProject;
+            }
+        }
+        return result;
     }
 
     private void failIfParametersAreNotInTheirValidValueRanges()
@@ -152,6 +248,18 @@ public class JLinkMojo
             getLog().error( message );
             throw new MojoFailureException( message );
         }
+
+        // CHECK if this assumption here is correct?
+        // if ( modulePaths != null && ( !modulePaths.isEmpty() ) )
+        // {
+        //
+        // // FIXME: Need to check if the given paths exists? and if they are
+        // // folders?
+        // // String message = "The given module-paths parameter " + modulePath.getAbsolutePath()
+        // // + " is not a directory or does not exist.";
+        // // getLog().error( message );
+        // // throw new MojoFailureException( message );
+        // }
     }
 
     private void deleteOutputDirectoryIfItAlreadyExists()
@@ -163,6 +271,7 @@ public class JLinkMojo
             // otherwise JLink will fail with a message "Error: directory already exists: ..."
             try
             {
+                getLog().debug( "Deleting existing " + outputDirectory.getAbsolutePath() );
                 FileUtils.forceDelete( outputDirectory );
             }
             catch ( IOException e )
@@ -174,7 +283,7 @@ public class JLinkMojo
         }
     }
 
-    private Commandline createJLinkCommandLine()
+    Commandline createJLinkCommandLine()
     {
         Commandline cmd = new Commandline();
 
@@ -189,11 +298,11 @@ public class JLinkMojo
             cmd.createArg().setValue( compression.toString() );
         }
 
-        // CHECK if this assumption here is correct?
-        if ( modulePath != null && modulePath.exists() && modulePath.isDirectory() )
+        if ( modulePaths != null )
         {
             cmd.createArg().setValue( "--module-path" );
-            cmd.createArg().setFile( modulePath );
+            StringBuilder sb = getColonSeparateList( modulePaths );
+            cmd.createArg().setValue( sb.toString() );
         }
 
         if ( limitModules != null && !limitModules.isEmpty() )
@@ -219,6 +328,28 @@ public class JLinkMojo
         return cmd;
     }
 
+    private StringBuilder getColonSeparateList( List<String> modulePaths )
+    {
+        StringBuilder sb = new StringBuilder();
+        for ( String module : modulePaths )
+        {
+            if ( sb.length() > 0 )
+            {
+                // FIXME: Check this ?
+                if ( SystemUtils.IS_OS_WINDOWS )
+                {
+                    sb.append( ';' );
+                }
+                else
+                {
+                    sb.append( ':' );
+                }
+            }
+            sb.append( module );
+        }
+        return sb;
+    }
+
     private StringBuilder getCommaSeparatedList( List<String> modules )
     {
         StringBuilder sb = new StringBuilder();

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 14/38: cleaned up pom file.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5ea7d268dcc4c3b2cd45b25c22740c3cdcb87d53
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Sep 2 14:42:09 2017 +0000

    cleaned up pom file.
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807051 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 32 --------------------------------
 1 file changed, 32 deletions(-)

diff --git a/pom.xml b/pom.xml
index 95114d0..6997f82 100644
--- a/pom.xml
+++ b/pom.xml
@@ -106,19 +106,6 @@
     </dependency>
 
     <dependency>
-      <groupId>io.takari.maven.plugins</groupId>
-      <artifactId>takari-plugin-testing</artifactId>
-      <version>2.9.0</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency> <!-- used by takari-plugin-testing, don't give it compile scope! -->
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-compat</artifactId>
-      <version>${mavenVersion}</version>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
       <version>1.10.19</version>
@@ -140,23 +127,4 @@
       </resource>
     </resources>
   </build>
-<!--   <build> -->
-<!--     <plugins> -->
-<!--       <plugin> -->
-<!--         <groupId>io.takari.maven.plugins</groupId> -->
-<!--         <artifactId>takari-lifecycle-plugin</artifactId> -->
-<!--         <version>1.12.1</version> -->
-<!--         <extensions>true</extensions> -->
-<!--         <executions> -->
-<!--           <execution> -->
-<!--             <id>testProperties</id> -->
-<!--             <phase>process-test-resources</phase> -->
-<!--             <goals> -->
-<!--               <goal>testProperties</goal> -->
-<!--             </goals> -->
-<!--           </execution> -->
-<!--         </executions> -->
-<!--       </plugin> -->
-<!--     </plugins> -->
-<!--   </build> -->
 </project>

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 28/38: Commented out test which actually does not work.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 57e3cef26b9a8e83356e185abec3fb21e4afc8ee
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Fri Sep 8 19:46:30 2017 +0000

    Commented out test which actually does not work.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807812 13f79535-47bb-0310-9956-ffa450edef68
---
 .../maven/plugins/jlink/AbsractJLinkMojoTest.java  | 48 ++++++++++------------
 1 file changed, 21 insertions(+), 27 deletions(-)

diff --git a/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java b/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java
index 630abd8..754bdfe 100644
--- a/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java
@@ -23,17 +23,11 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
-import java.io.ByteArrayOutputStream;
 import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
 import java.util.Arrays;
 import java.util.Collections;
 
-import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.logging.Log;
-import org.codehaus.plexus.util.cli.CommandLineException;
-import org.codehaus.plexus.util.cli.Commandline;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -115,25 +109,25 @@ public class AbsractJLinkMojoTest
         assertThat( result ).isEqualTo( "A,B" );
     }
 
-    @Test
-    public void xxx()
-        throws MojoExecutionException, IOException, CommandLineException
-    {
-        Process p = mock( Process.class );
-
-        String b = "Error occured";
-        byte[] bytes = b.getBytes();
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        baos.write( bytes );
-        
-        when (p.getOutputStream()).thenReturn( baos );
-        
-        Commandline cmd = mock( Commandline.class );
-        when (cmd.execute()).thenReturn( p );
-        
-        File outputDirectory = mock( File.class );
-
-        mojoMock.executeCommand( cmd, outputDirectory );
-
-    }
+//    @Test
+//    public void xxx()
+//        throws MojoExecutionException, IOException, CommandLineException
+//    {
+//        Process p = mock( Process.class );
+//
+//        String b = "Error occured";
+//        byte[] bytes = b.getBytes();
+//        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+//        baos.write( bytes );
+//        
+//        when (p.getOutputStream()).thenReturn( baos );
+//        
+//        Commandline cmd = mock( Commandline.class );
+//        when (cmd.execute()).thenReturn( p );
+//        
+//        File outputDirectory = mock( File.class );
+//
+//        mojoMock.executeCommand( cmd, outputDirectory );
+//
+//    }
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 21/38: Added plexus-java cause we need information about module-info.class to correctly create a Java Run Time Image. Using the dependencies only to handle modules.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2c19e6dfeed24f17b3a404f7d5aaaad8395fe1f8
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Tue Sep 5 17:47:16 2017 +0000

    Added plexus-java cause we need information about module-info.class
    to correctly create a Java Run Time Image.
    Using the dependencies only to handle modules.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807376 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  34 +++
 .../maven/plugins/jlink/AbstractJLinkMojo.java     |   2 +-
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  | 234 ++++++++++++---------
 src/site/apt/usage.apt.vm                          |  10 +-
 4 files changed, 182 insertions(+), 98 deletions(-)

diff --git a/pom.xml b/pom.xml
index a76de0e..56b3dda 100644
--- a/pom.xml
+++ b/pom.xml
@@ -95,6 +95,11 @@
       <version>3.5</version>
     </dependency>
     <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-java</artifactId>
+      <version>0.9.3-SNAPSHOT</version>
+    </dependency>
+    <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-lang3</artifactId>
       <version>3.6</version>
@@ -121,6 +126,35 @@
   </dependencies>
 
   <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-plugin-plugin</artifactId>
+          <version>3.5</version>
+        </plugin>
+
+        <plugin>
+          <artifactId>maven-enforcer-plugin</artifactId>
+          <executions>
+            <execution>
+              <id>enforce-bytecode-version</id>
+              <configuration>
+                <rules>
+                  <enforceBytecodeVersion>
+                    <maxJdkVersion>1.7</maxJdkVersion>
+                    <excludes>
+                      <exclude>org.ow2.asm:asm</exclude>
+                    </excludes>
+                  </enforceBytecodeVersion>
+                  <requireSameVersions />
+                </rules>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+      </plugins>
+    </pluginManagement>
     <resources>
       <resource>
         <directory>src/main/filtered-resources</directory>
diff --git a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
index 9c5bab7..5c904a6 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
@@ -189,7 +189,7 @@ public abstract class AbstractJLinkMojo
 
     }
 
-    private Toolchain getToolchain()
+    protected Toolchain getToolchain()
     {
         Toolchain tc = null;
 
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 32ed9d0..6ddbd0b 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -23,9 +23,13 @@ import java.io.File;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
 
-import org.apache.maven.model.Dependency;
+import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugins.annotations.Component;
@@ -34,9 +38,18 @@ import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.apache.maven.project.MavenProject;
+import org.apache.maven.shared.utils.StringUtils;
+import org.apache.maven.shared.utils.logging.MessageUtils;
+import org.apache.maven.toolchain.Toolchain;
+import org.apache.maven.toolchain.java.DefaultJavaToolChain;
 import org.codehaus.plexus.archiver.Archiver;
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.zip.ZipArchiver;
+import org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor;
+import org.codehaus.plexus.languages.java.jpms.LocationManager;
+import org.codehaus.plexus.languages.java.jpms.ResolvePathsRequest;
+import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult;
+import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult.ModuleNameSource;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
@@ -49,16 +62,31 @@ import org.codehaus.plexus.util.cli.Commandline;
  */
 // TODO: Check if the resolution scope is correct?
 // CHECKSTYLE_OFF: LineLength
-@Mojo( name = "jlink", requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME, defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true )
+@Mojo( name = "jlink", requiresDependencyCollection = ResolutionScope.COMPILE_PLUS_RUNTIME, defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true )
 // CHECKSTYLE_ON: LineLength
 public class JLinkMojo
     extends AbstractJLinkMojo
 {
-    private static final String JMOD_PACKAGING = "jmod";
-
     private static final String JMODS = "jmods";
 
-    private static final String JAR_PACKAGING = "jar";
+    private List<String> classpathElements;
+
+    private List<String> modulepathElements;
+
+    private Map<String, JavaModuleDescriptor> pathElements;
+
+    @Component
+    private LocationManager locationManager;
+
+    /**
+     * <p>
+     * Specify the requirements for this jdk toolchain. This overrules the toolchain selected by the
+     * maven-toolchain-plugin.
+     * </p>
+     * <strong>note:</strong> requires at least Maven 3.3.1
+     */
+    @Parameter
+    private Map<String, String> jdkToolchain;
 
     /**
      * This is intended to strip debug information out. The command line equivalent of <code>jlink</code> is:
@@ -137,8 +165,6 @@ public class JLinkMojo
     @Parameter
     private String endian;
 
-    // TODO: Check if we should allow to extend the modulePaths by manual additions in the pom file?
-    @Parameter( defaultValue = "${project.compileClasspathElements}", readonly = true, required = true )
     private List<String> modulePaths;
 
     /**
@@ -230,35 +256,30 @@ public class JLinkMojo
 
         ifOutputDirectoryExistsDelteIt();
 
-        List<Dependency> dependencies = getSession().getCurrentProject().getDependencies();
+        preparePaths();
 
-        List<MavenProject> modulesToAdd = new ArrayList<>();
-        // if ( dependencies.isEmpty() )
-        // {
-        // // Do we need to do something if no dependencies have been defined ?
-        // // WARNING / ERROR or failure?
-        // }
         getLog().info( "The following dependencies will be linked into the runtime image:" );
-        for ( Dependency dependency : dependencies )
+
+        this.addModules = new ArrayList<>();
+        this.modulePaths = new ArrayList<>();
+        for ( Entry<String, JavaModuleDescriptor> item : pathElements.entrySet() )
         {
-            // We will support "jmod" as well as "jar"
-            // TODO: Think about jmod's cause they can contain config files etc. ? What todo with them? Are they already
-            // handled by jlink ?
-            if ( JAR_PACKAGING.equals( dependency.getType() ) || JMOD_PACKAGING.equals( dependency.getType() ) )
+            // Isn't there a better solution?
+            if ( item.getValue() == null )
             {
-                MavenProject mp = findDependencyInProjects( dependency );
-                getLog().info( " -> " + mp.getId() );
-                // TODO: What about module name != artifactId which has been
-                // defined in module-info.java file!
-                // This would mean to read the module-info information from the jmod/jar file for example to
-                // get the appropriate information.
-                modulesToAdd.add( mp );
+                String message = "The given dependency " + item.getKey()
+                    + " does not have a module-info.java file. So it can't be linked.";
+                getLog().error( message );
+                throw new MojoFailureException( message );
             }
+            getLog().debug( "pathElements Item:" + item.getKey() + " v:" + item.getValue().name() );
+            getLog().info( " -> module: " + item.getValue().name() + " ( " + item.getKey() + " )" );
+            // We use the real module name and not the artifact Id...
+            this.addModules.add( item.getValue().name() );
+            this.modulePaths.add( item.getKey() );
         }
-
-        handleAddModules( modulesToAdd );
-
-        handleModulePath( jmodsFolder, modulesToAdd );
+        // The jmods directory of the JDK
+        this.modulePaths.add( jmodsFolder.getAbsolutePath() );
 
         Commandline cmd;
         try
@@ -284,6 +305,86 @@ public class JLinkMojo
         getProject().getArtifact().setFile( createZipArchiveFromImage );
     }
 
+    private List<File> getCompileClasspathElements( MavenProject project )
+    {
+        List<File> list = new ArrayList<File>( project.getArtifacts().size() + 1 );
+
+        for ( Artifact a : project.getArtifacts() )
+        {
+            list.add( a.getFile() );
+        }
+        return list;
+    }
+
+    private void preparePaths()
+    {
+        // For now only allow named modules. Once we can create a graph with ASM we can specify exactly the modules
+        // and we can detect if auto modules are used. In that case, MavenProject.setFile() should not be used, so
+        // you cannot depend on this project and so it won't be distributed.
+
+        modulepathElements = new ArrayList<String>();
+        classpathElements = new ArrayList<String>();
+        pathElements = new LinkedHashMap<String, JavaModuleDescriptor>();
+
+        ResolvePathsResult<File> resolvePathsResult;
+        try
+        {
+            Collection<File> dependencyArtifacts = getCompileClasspathElements( getProject() );
+
+            ResolvePathsRequest<File> request = ResolvePathsRequest.withFiles( dependencyArtifacts );
+
+            Toolchain toolchain = getToolchain();
+            if ( toolchain != null && toolchain instanceof DefaultJavaToolChain )
+            {
+                request.setJdkHome( new File( ( (DefaultJavaToolChain) toolchain ).getJavaHome() ) );
+            }
+
+            resolvePathsResult = locationManager.resolvePaths( request );
+
+            JavaModuleDescriptor moduleDescriptor = resolvePathsResult.getMainModuleDescriptor();
+
+            for ( Map.Entry<File, ModuleNameSource> entry : resolvePathsResult.getModulepathElements().entrySet() )
+            {
+                if ( ModuleNameSource.FILENAME.equals( entry.getValue() ) )
+                {
+                    final String message = "Required filename-based automodules detected. "
+                        + "Please don't publish this project to a public artifact repository!";
+
+                    if ( moduleDescriptor.exports().isEmpty() )
+                    {
+                        // application
+                        getLog().info( message );
+                    }
+                    else
+                    {
+                        // library
+                        writeBoxedWarning( message );
+                    }
+                    break;
+                }
+            }
+
+            for ( Map.Entry<File, JavaModuleDescriptor> entry : resolvePathsResult.getPathElements().entrySet() )
+            {
+                pathElements.put( entry.getKey().getPath(), entry.getValue() );
+            }
+
+            for ( File file : resolvePathsResult.getClasspathElements() )
+            {
+                classpathElements.add( file.getPath() );
+            }
+
+            for ( File file : resolvePathsResult.getModulepathElements().keySet() )
+            {
+                modulepathElements.add( file.getPath() );
+            }
+        }
+        catch ( IOException e )
+        {
+            getLog().warn( e.getMessage() );
+        }
+    }
+
     private String getExecutable()
         throws MojoFailureException
     {
@@ -338,58 +439,6 @@ public class JLinkMojo
 
     }
 
-    private void handleAddModules( List<MavenProject> modulesToAdd )
-    {
-        if ( addModules == null )
-        {
-            addModules = new ArrayList<>();
-        }
-
-        for ( MavenProject module : modulesToAdd )
-        {
-            // TODO: Check if this is the correct way?
-            // This implies the artifactId is equal to moduleName which might not always be the case!
-            addModules.add( module.getArtifactId() );
-        }
-    }
-
-    /**
-     * @param jmodsFolder The folder where to find the jmods of the JDK.
-     * @param modulesToAdd The modules to be added.
-     */
-    private void handleModulePath( File jmodsFolder, List<MavenProject> modulesToAdd )
-    {
-        if ( modulePaths == null )
-        {
-            modulePaths = new ArrayList<>();
-        }
-
-        // The jmods directory of the JDK
-        modulePaths.add( jmodsFolder.getAbsolutePath() );
-
-        for ( MavenProject mavenProject : modulesToAdd )
-        {
-            File output = new File( mavenProject.getBuild().getDirectory(), JMODS );
-            modulePaths.add( output.getAbsolutePath() );
-        }
-    }
-
-    private MavenProject findDependencyInProjects( Dependency dep )
-    {
-        List<MavenProject> sortedProjects = getSession().getProjectDependencyGraph().getSortedProjects();
-        MavenProject result = null;
-        for ( MavenProject mavenProject : sortedProjects )
-        {
-            if ( dep.getGroupId().equals( mavenProject.getGroupId() )
-                && dep.getArtifactId().equals( mavenProject.getArtifactId() )
-                && dep.getVersion().equals( mavenProject.getVersion() ) )
-            {
-                result = mavenProject;
-            }
-        }
-        return result;
-    }
-
     private void failIfParametersAreNotInTheirValidValueRanges()
         throws MojoFailureException
     {
@@ -408,18 +457,6 @@ public class JLinkMojo
             getLog().error( message );
             throw new MojoFailureException( message );
         }
-
-        // CHECK if this assumption here is correct?
-        // if ( modulePaths != null && ( !modulePaths.isEmpty() ) )
-        // {
-        //
-        // // FIXME: Need to check if the given paths exists? and if they are
-        // // folders?
-        // // String message = "The given module-paths parameter " + modulePath.getAbsolutePath()
-        // // + " is not a directory or does not exist.";
-        // // getLog().error( message );
-        // // throw new MojoFailureException( message );
-        // }
     }
 
     private void ifOutputDirectoryExistsDelteIt()
@@ -571,4 +608,13 @@ public class JLinkMojo
     {
         return addModules != null && !addModules.isEmpty();
     }
+    
+    private void writeBoxedWarning( String message )
+    {
+        String line = StringUtils.repeat( "*", message.length() + 4 );
+        getLog().warn( line );
+        getLog().warn( "* " + MessageUtils.buffer().strong( message )  + " *" );
+        getLog().warn( line );
+    }
+    
 }
diff --git a/src/site/apt/usage.apt.vm b/src/site/apt/usage.apt.vm
index 93f631a..f5db5ea 100644
--- a/src/site/apt/usage.apt.vm
+++ b/src/site/apt/usage.apt.vm
@@ -30,6 +30,11 @@ Usage
   The Maven JLink plugin is used to create {{{http://openjdk.java.net/jeps/220}Modular Run-Time Images}} with
   JDK 9.
   
+  The intended artifacts to be linked together into a Modular Run-Time Image 
+  are the <<jmod>> and <<jar>> files. JMod files can be created by using the
+  {{{../maven-jmod-plugin/}Maven JMod Plugin}} and <<jar>> files can be
+  created by using the {{{../maven-jar-plugin/}Maven JAR Plugin}}.
+   
 * Configuration of the Maven JLink Plugin
 
   To use the Maven JLink Plugin you have to configure it as an <<<extensions>>> which means
@@ -54,9 +59,8 @@ Usage
 </project>
 +-----
 
-  The configuration elements contains the configuration for the plugin like
-  any other Maven plugins.
-
+  The configuration elements contains the configuration for the plugin 
+  {{{https://maven.apache.org/guides/mini/guide-configuring-plugins.html}}like any other Maven plugin}}.
   
 * Usage of the Maven JLink Plugin
 

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 34/38: [MJLINK-4] run this IT only when Java 9

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f73f2ded6225ae1de2c25e9d34729864ebe4dcb9
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Sat Nov 4 15:02:59 2017 +0000

    [MJLINK-4] run this IT only when Java 9
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1814295 13f79535-47bb-0310-9956-ffa450edef68
---
 .../MJLINK-4_dependencyResolution/invoker.properties   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/it/projects/MJLINK-4_dependencyResolution/invoker.properties b/src/it/projects/MJLINK-4_dependencyResolution/invoker.properties
new file mode 100644
index 0000000..4e793ca
--- /dev/null
+++ b/src/it/projects/MJLINK-4_dependencyResolution/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.java.version=1.9+

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 33/38: Simplify code

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 238050c4c8d0352c7e69f9400fe34b4e24cb6f0c
Author: Robert Scholte <rf...@apache.org>
AuthorDate: Fri Oct 20 10:36:49 2017 +0000

    Simplify code
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1812731 13f79535-47bb-0310-9956-ffa450edef68
---
 .../maven/plugins/jlink/AbstractJLinkMojo.java     |  16 +--
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  | 140 ++++++++-------------
 2 files changed, 54 insertions(+), 102 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
index 5c904a6..2a47e45 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
@@ -21,8 +21,8 @@ package org.apache.maven.plugins.jlink;
 
 import java.io.File;
 import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
@@ -210,7 +210,7 @@ public abstract class AbstractJLinkMojo
                     tc = tcs.get( 0 );
                 }
             }
-            catch ( NoSuchMethodException e )
+            catch ( ReflectiveOperationException e )
             {
                 // ignore
             }
@@ -218,18 +218,10 @@ public abstract class AbstractJLinkMojo
             {
                 // ignore
             }
-            catch ( IllegalAccessException e )
-            {
-                // ignore
-            }
             catch ( IllegalArgumentException e )
             {
                 // ignore
             }
-            catch ( InvocationTargetException e )
-            {
-                // ignore
-            }
         }
 
         if ( tc == null )
@@ -338,7 +330,7 @@ public abstract class AbstractJLinkMojo
      * @param modulePaths The list of elements.
      * @return The string which contains the elements separated by {@link File#pathSeparatorChar}.
      */
-    protected String getPlatformDependSeparateList( List<String> modulePaths )
+    protected String getPlatformDependSeparateList( Collection<String> modulePaths )
     {
         StringBuilder sb = new StringBuilder();
         for ( String module : modulePaths )
@@ -357,7 +349,7 @@ public abstract class AbstractJLinkMojo
      * @param modules The list of modules.
      * @return The string with the module list which is separated by {@code ,}.
      */
-    protected String getCommaSeparatedList( List<String> modules )
+    protected String getCommaSeparatedList( Collection<String> modules )
     {
         StringBuilder sb = new StringBuilder();
         for ( String module : modules )
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index be29b02..2016e30 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -24,7 +24,7 @@ import java.io.IOException;
 import java.io.PrintStream;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.LinkedHashMap;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -38,8 +38,6 @@ import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.shared.utils.StringUtils;
-import org.apache.maven.shared.utils.logging.MessageUtils;
 import org.apache.maven.toolchain.Toolchain;
 import org.apache.maven.toolchain.java.DefaultJavaToolChain;
 import org.codehaus.plexus.archiver.Archiver;
@@ -49,7 +47,6 @@ import org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor;
 import org.codehaus.plexus.languages.java.jpms.LocationManager;
 import org.codehaus.plexus.languages.java.jpms.ResolvePathsRequest;
 import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult;
-import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult.ModuleNameSource;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
@@ -68,12 +65,6 @@ public class JLinkMojo
 {
     private static final String JMODS = "jmods";
 
-    private List<String> classpathElements;
-
-    private List<String> modulepathElements;
-
-    private Map<String, JavaModuleDescriptor> pathElements;
-
     @Component
     private LocationManager locationManager;
 
@@ -261,35 +252,41 @@ public class JLinkMojo
 
         ifOutputDirectoryExistsDelteIt();
 
-        preparePaths();
-
-        getLog().info( "The following dependencies will be linked into the runtime image:" );
-
-        this.addModules = new ArrayList<>();
-        this.modulePaths = new ArrayList<>();
-        for ( Entry<String, JavaModuleDescriptor> item : pathElements.entrySet() )
+        Collection<String> modulesToAdd;
+        if ( addModules == null )
         {
-            // Isn't there a better solution?
-            if ( item.getValue() == null )
-            {
-                String message = "The given dependency " + item.getKey()
-                    + " does not have a module-info.java file. So it can't be linked.";
-                getLog().error( message );
-                throw new MojoFailureException( message );
-            }
-            getLog().debug( "pathElements Item:" + item.getKey() + " v:" + item.getValue().name() );
-            getLog().info( " -> module: " + item.getValue().name() + " ( " + item.getKey() + " )" );
+            modulesToAdd = new ArrayList<>();
+        }
+        else
+        {
+            modulesToAdd = new ArrayList<>( addModules );
+        }
+        
+        Collection<String> pathsOfModules;
+        if ( modulePaths == null )
+        {
+            pathsOfModules = new ArrayList<>();
+        }
+        else
+        {
+            pathsOfModules = new ArrayList<>( modulePaths );
+        }
+        
+        for ( Entry<String, File> item : getModulePathElements().entrySet() )
+        {
+            getLog().info( " -> module: " + item.getKey() + " ( " + item.getValue().getPath() + " )" );
+
             // We use the real module name and not the artifact Id...
-            this.addModules.add( item.getValue().name() );
-            this.modulePaths.add( item.getKey() );
+            modulesToAdd.add( item.getKey() );
+            pathsOfModules.add( item.getValue().getPath() );
         }
         // The jmods directory of the JDK
-        this.modulePaths.add( jmodsFolder.getAbsolutePath() );
+        pathsOfModules.add( jmodsFolder.getAbsolutePath() );
 
         Commandline cmd;
         try
         {
-            cmd = createJLinkCommandLine();
+            cmd = createJLinkCommandLine( pathsOfModules, modulesToAdd );
         }
         catch ( IOException e )
         {
@@ -321,17 +318,14 @@ public class JLinkMojo
         return list;
     }
 
-    private void preparePaths()
+    private Map<String, File> getModulePathElements() throws MojoFailureException
     {
         // For now only allow named modules. Once we can create a graph with ASM we can specify exactly the modules
         // and we can detect if auto modules are used. In that case, MavenProject.setFile() should not be used, so
         // you cannot depend on this project and so it won't be distributed.
 
-        modulepathElements = new ArrayList<String>();
-        classpathElements = new ArrayList<String>();
-        pathElements = new LinkedHashMap<String, JavaModuleDescriptor>();
-
-        ResolvePathsResult<File> resolvePathsResult;
+        Map<String, File> modulepathElements = new HashMap<>();
+        
         try
         {
             Collection<File> dependencyArtifacts = getCompileClasspathElements( getProject() );
@@ -344,50 +338,30 @@ public class JLinkMojo
                 request.setJdkHome( new File( ( (DefaultJavaToolChain) toolchain ).getJavaHome() ) );
             }
 
-            resolvePathsResult = locationManager.resolvePaths( request );
+            ResolvePathsResult<File> resolvePathsResult = locationManager.resolvePaths( request );
 
-            JavaModuleDescriptor moduleDescriptor = resolvePathsResult.getMainModuleDescriptor();
-
-            for ( Map.Entry<File, ModuleNameSource> entry : resolvePathsResult.getModulepathElements().entrySet() )
+            for ( Map.Entry<File, JavaModuleDescriptor> entry : resolvePathsResult.getPathElements().entrySet() )
             {
-                if ( ModuleNameSource.FILENAME.equals( entry.getValue() ) )
+                if ( entry.getValue() != null )
                 {
-                    final String message = "Required filename-based automodules detected. "
-                        + "Please don't publish this project to a public artifact repository!";
-
-                    if ( moduleDescriptor.exports().isEmpty() )
-                    {
-                        // application
-                        getLog().info( message );
-                    }
-                    else
-                    {
-                        // library
-                        writeBoxedWarning( message );
-                    }
-                    break;
+                    // Don't warn for automatic modules, let the jlink tool do that
+                    modulepathElements.put( entry.getValue().name(), entry.getKey() );
+                }
+                else
+                {
+                    String message = "The given dependency " + entry.getKey()
+                        + " does not have a module-info.java file. So it can't be linked.";
+                    getLog().error( message );
+                    throw new MojoFailureException( message );
                 }
-            }
-
-            for ( Map.Entry<File, JavaModuleDescriptor> entry : resolvePathsResult.getPathElements().entrySet() )
-            {
-                pathElements.put( entry.getKey().getPath(), entry.getValue() );
-            }
-
-            for ( File file : resolvePathsResult.getClasspathElements() )
-            {
-                classpathElements.add( file.getPath() );
-            }
-
-            for ( File file : resolvePathsResult.getModulepathElements().keySet() )
-            {
-                modulepathElements.add( file.getPath() );
             }
         }
         catch ( IOException e )
         {
             getLog().warn( e.getMessage() );
         }
+        
+        return modulepathElements;
     }
 
     private String getExecutable()
@@ -485,7 +459,7 @@ public class JLinkMojo
         }
     }
 
-    private Commandline createJLinkCommandLine()
+    private Commandline createJLinkCommandLine( Collection<String> pathsOfModules, Collection<String> modulesToAdd )
         throws IOException
     {
         File file = new File( outputDirectoryImage.getParentFile(), "jlinkArgs" );
@@ -529,13 +503,13 @@ public class JLinkMojo
             argsFile.append( '"' ).append( disablePlugin ).println( '"' );
 
         }
-        if ( modulePaths != null )
+        if ( pathsOfModules != null )
         {
             //@formatter:off
             argsFile.println( "--module-path" );
             argsFile
               .append( '"' )
-              .append( getPlatformDependSeparateList( modulePaths )
+              .append( getPlatformDependSeparateList( pathsOfModules )
                          .replace( "\\", "\\\\" ) 
                      ).println( '"' );
             //@formatter:off
@@ -565,12 +539,12 @@ public class JLinkMojo
             argsFile.println( sb );
         }
 
-        if ( hasModules() )
+        if ( !modulesToAdd.isEmpty() )
         {
             argsFile.println( "--add-modules" );
             // This must be name of the module and *NOT* the name of the
             // file! Can we somehow pre check this information to fail early?
-            String sb = getCommaSeparatedList( addModules );
+            String sb = getCommaSeparatedList( modulesToAdd );
             argsFile.append( '"' ).append( sb.replace( "\\", "\\\\" ) ).println( '"' );
         }
 
@@ -608,18 +582,4 @@ public class JLinkMojo
     {
         return limitModules != null && !limitModules.isEmpty();
     }
-
-    private boolean hasModules()
-    {
-        return addModules != null && !addModules.isEmpty();
-    }
-    
-    private void writeBoxedWarning( String message )
-    {
-        String line = StringUtils.repeat( "*", message.length() + 4 );
-        getLog().warn( line );
-        getLog().warn( "* " + MessageUtils.buffer().strong( message )  + " *" );
-        getLog().warn( line );
-    }
-    
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 16/38: Fixed issue in usage page.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 20cf8a40579f8b46cd685cc614ed40fd35177fa5
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Sep 2 16:29:38 2017 +0000

    Fixed issue in usage page.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807065 13f79535-47bb-0310-9956-ffa450edef68
---
 src/site/apt/usage.apt.vm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/site/apt/usage.apt.vm b/src/site/apt/usage.apt.vm
index 6acebf0..a158306 100644
--- a/src/site/apt/usage.apt.vm
+++ b/src/site/apt/usage.apt.vm
@@ -33,7 +33,7 @@ Usage
 * Configuration of the Maven JLink Plugin
 
   To use the Maven JLink Plugin you have to configure it as an <<<extensions>>> which means
-  the configuration in your pom file looks like this:
+  the configuration in your pom file has to look like this:
   
 +-----
 <project>
@@ -179,12 +179,12 @@ Usage
     <dependency>
       <groupId>com.corporate.project</groupId>
       <artifactId>mod-1</artifactId>
-      <version>${project.version}</version>
+      <version>\${project.version}</version>
     </dependency>
     <dependency>
       <groupId>com.corporate.project</groupId>
       <artifactId>mod-2</artifactId>
-      <version>${project.version}</version>
+      <version>\${project.version}</version>
     </dependency>
   </dependencies>  
    [...]

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 30/38: [maven-release-plugin] prepare for next development iteration

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8d7057a1179f1d1afc5ca9a767e0280e1a8b3490
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Sep 9 14:11:23 2017 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807907 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7c15a84..454f3e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
   </parent>
 
   <artifactId>maven-jlink-plugin</artifactId>
-  <version>3.0.0-alpha-1</version>
+  <version>3.0.0-alpha-2-SNAPSHOT</version>
   <packaging>maven-plugin</packaging>
 
   <name>Apache Maven JLink Plugin</name>
@@ -43,9 +43,9 @@
   </prerequisites>
 
   <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-jlink-plugin-3.0.0-alpha-1</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-jlink-plugin-3.0.0-alpha-1</developerConnection>
-    <url>http://svn.apache.org/viewvc/maven/plugins/tags/maven-jlink-plugin-3.0.0-alpha-1</url>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-jlink-plugin/</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-jlink-plugin/</developerConnection>
+    <url>http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jlink-plugin/</url>
   </scm>
 
   <issueManagement>

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 24/38: Upgraded to plexus-java version 0.9.3

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c7bfaa7fa75217c7ae4f8ab89016d0ce26d61ee4
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Wed Sep 6 19:02:29 2017 +0000

    Upgraded to plexus-java version 0.9.3
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807519 13f79535-47bb-0310-9956-ffa450edef68
---
 deploySite.sh | 2 +-
 pom.xml       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/deploySite.sh b/deploySite.sh
index f6c265d..e5eb054 100755
--- a/deploySite.sh
+++ b/deploySite.sh
@@ -19,5 +19,5 @@
 # under the License.
 #
 
-mvn -Preporting site site:stage $@
+mvn -DdependencyDetailsEnabled=false -Preporting site site:stage $@
 mvn scm-publish:publish-scm $@
diff --git a/pom.xml b/pom.xml
index 56b3dda..982237a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,7 +97,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-java</artifactId>
-      <version>0.9.3-SNAPSHOT</version>
+      <version>0.9.3</version>
     </dependency>
     <dependency>
       <groupId>org.apache.commons</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 08/38: o Removed resources plugin fomr life cycle definition cause we can't offer supplemental files only via jlink o Usage of jar as well as jmod packaging for link. o Improved code o JLink plugin creates now a zip file of the resulting image.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit d4abcb651e7293a2ae3f723649a5aadf14aa7c34
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Mon Jun 5 21:54:47 2017 +0000

    o Removed resources plugin fomr life cycle definition cause
      we can't offer supplemental files only via jlink
    o Usage of jar as well as jmod packaging for link.
    o Improved code
    o JLink plugin creates now a zip file of the resulting
      image.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1797711 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  17 +-
 .../META-INF/plexus/components.xml                 |   7 +-
 .../maven/plugins/jlink/AbstractJLinkMojo.java     |  97 ++++++++---
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  | 179 ++++++++++++++++-----
 4 files changed, 229 insertions(+), 71 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0d1b72f..296a803 100644
--- a/pom.xml
+++ b/pom.xml
@@ -83,16 +83,21 @@
       <version>${mavenVersion}</version>
     </dependency>
     <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-archiver</artifactId>
+      <version>3.1.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-archiver</artifactId>
+      <version>3.4</version>
+    </dependency> 
+    
+    <dependency>
       <groupId>commons-lang</groupId>
       <artifactId>commons-lang</artifactId>
       <version>2.4</version>
     </dependency>
-<!--     <dependency> -->
-<!--       <groupId>org.mockito</groupId> -->
-<!--       <artifactId>mockito-core</artifactId> -->
-<!--       <version>1.9.5</version> -->
-<!--       <scope>test</scope> -->
-<!--     </dependency> -->
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
diff --git a/src/main/filtered-resources/META-INF/plexus/components.xml b/src/main/filtered-resources/META-INF/plexus/components.xml
index b1554b1..3a964b9 100644
--- a/src/main/filtered-resources/META-INF/plexus/components.xml
+++ b/src/main/filtered-resources/META-INF/plexus/components.xml
@@ -30,6 +30,8 @@
       <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
       <configuration>
         <type>jlink</type>
+        <extension>zip</extension>
+        <!-- Need to check the following? -->
         <includesDependencies>true</includesDependencies>
         <language>java</language>
         <addedToClasspath>false</addedToClasspath>
@@ -54,12 +56,11 @@
             <id>default</id>
             <!-- START SNIPPET: jlink-lifecycle -->
             <phases>
-              <process-resources>
-                org.apache.maven.plugins:maven-resources-plugin:3.0.1:resources
-              </process-resources>
               <package>
                 org.apache.maven.plugins:maven-jlink-plugin:${project.version}:jlink
               </package>
+              <!-- What should be installed?
+              JRE image in zip/tar format? -->
               <install>
                 org.apache.maven.plugins:maven-install-plugin:2.5.2:install
               </install>
diff --git a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
index 9e6a99e..271e71a 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
@@ -42,20 +42,17 @@ import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
 /**
- * 
  * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
- *
  */
 public abstract class AbstractJLinkMojo
     extends AbstractMojo
 {
     /**
      * <p>
-     * Specify the requirements for this jdk toolchain.
-     * This overrules the toolchain selected by the maven-toolchain-plugin.
+     * Specify the requirements for this jdk toolchain. This overrules the toolchain selected by the
+     * maven-toolchain-plugin.
      * </p>
      * <strong>note:</strong> requires at least Maven 3.3.1
-     * 
      */
     @Parameter
     private Map<String, String> jdkToolchain;
@@ -65,11 +62,12 @@ public abstract class AbstractJLinkMojo
 
     @Parameter( defaultValue = "${session}", readonly = true, required = true )
     private MavenSession session;
-    
+
     @Component
     private ToolchainManager toolchainManager;
-    
-    protected String getJLinkExecutable() throws IOException
+
+    protected String getJLinkExecutable()
+        throws IOException
     {
         Toolchain tc = getToolchain();
 
@@ -99,8 +97,7 @@ public abstract class AbstractJLinkMojo
 
             if ( !jLinkExe.isFile() )
             {
-                throw new IOException( "The jlink executable '" + jLinkExe
-                    + "' doesn't exist or is not a file." );
+                throw new IOException( "The jlink executable '" + jLinkExe + "' doesn't exist or is not a file." );
             }
             return jLinkExe.getAbsolutePath();
         }
@@ -110,7 +107,7 @@ public abstract class AbstractJLinkMojo
         // By default, System.getProperty( "java.home" ) = JRE_HOME and JRE_HOME
         // should be in the JDK_HOME
         // ----------------------------------------------------------------------
-        // For IBM's JDK 1.2 
+        // For IBM's JDK 1.2
         // Really ?
         if ( SystemUtils.IS_OS_AIX )
         {
@@ -159,8 +156,9 @@ public abstract class AbstractJLinkMojo
 
         return jLinkExe.getAbsolutePath();
     }
-    
-    protected void executeCommand ( Commandline cmd, File outputDirectory ) throws MojoExecutionException
+
+    protected void executeCommand( Commandline cmd, File outputDirectory )
+        throws MojoExecutionException
     {
         if ( getLog().isDebugEnabled() )
         {
@@ -180,7 +178,7 @@ public abstract class AbstractJLinkMojo
             {
                 if ( StringUtils.isNotEmpty( output ) )
                 {
-                    //Reconsider to use WARN / ERROR ?
+                    // Reconsider to use WARN / ERROR ?
                     getLog().error( output );
                 }
 
@@ -207,24 +205,22 @@ public abstract class AbstractJLinkMojo
         }
 
     }
-    
+
     private Toolchain getToolchain()
     {
         Toolchain tc = null;
-        
+
         if ( jdkToolchain != null )
         {
             // Maven 3.3.1 has plugin execution scoped Toolchain Support
             try
             {
-                Method getToolchainsMethod =
-                    toolchainManager.getClass().getMethod( "getToolchains", MavenSession.class, String.class,
-                                                           Map.class );
+                Method getToolchainsMethod = toolchainManager.getClass().getMethod( "getToolchains", MavenSession.class,
+                                                                                    String.class, Map.class );
 
                 @SuppressWarnings( "unchecked" )
                 List<Toolchain> tcs =
-                    (List<Toolchain>) getToolchainsMethod.invoke( toolchainManager, session, "jdk",
-                                                                  jdkToolchain );
+                    (List<Toolchain>) getToolchainsMethod.invoke( toolchainManager, session, "jdk", jdkToolchain );
 
                 if ( tcs != null && tcs.size() > 0 )
                 {
@@ -252,12 +248,12 @@ public abstract class AbstractJLinkMojo
                 // ignore
             }
         }
-        
+
         if ( tc == null )
         {
             tc = toolchainManager.getToolchainFromBuildContext( "jdk", session );
         }
-        
+
         return tc;
     }
 
@@ -271,5 +267,60 @@ public abstract class AbstractJLinkMojo
         return session;
     }
 
+    /**
+     * Returns the archive file to generate, based on an optional classifier.
+     *
+     * @param basedir the output directory
+     * @param finalName the name of the ear file
+     * @param classifier an optional classifier
+     * @return the file to generate
+     */
+    protected File getArchiveFile( File basedir, String finalName, String classifier, String archiveExt )
+    {
+        if ( basedir == null )
+        {
+            throw new IllegalArgumentException( "basedir is not allowed to be null" );
+        }
+        if ( finalName == null )
+        {
+            throw new IllegalArgumentException( "finalName is not allowed to be null" );
+        }
+        if ( archiveExt == null )
+        {
+            throw new IllegalArgumentException( "archiveExt is not allowed to be null" );
+        }
+
+        if ( finalName.isEmpty() )
+        {
+            throw new IllegalArgumentException( "finalName is not allowed to be empty." );
+        }
+        if ( archiveExt.isEmpty() )
+        {
+            throw new IllegalArgumentException( "archiveExt is not allowed to be empty." );
+        }
+
+        StringBuilder fileName = new StringBuilder( finalName );
+
+        if ( hasClassifier( classifier ) )
+        {
+            fileName.append( "-" ).append( classifier );
+        }
+
+        fileName.append( '.' );
+        fileName.append( archiveExt );
+
+        return new File( basedir, fileName.toString() );
+    }
+
+    protected boolean hasClassifier( String classifier )
+    {
+        boolean result = false;
+        if ( classifier != null && classifier.trim().length() > 0 )
+        {
+            result = true;
+        }
+
+        return result;
+    }
 
 }
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index a25f3e1..3b0ba15 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -29,11 +29,17 @@ import org.apache.commons.lang.SystemUtils;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectHelper;
+import org.codehaus.plexus.archiver.Archiver;
+import org.codehaus.plexus.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.codehaus.plexus.archiver.zip.ZipArchiver;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
@@ -88,6 +94,12 @@ import org.codehaus.plexus.util.cli.Commandline;
 public class JLinkMojo
     extends AbstractJLinkMojo
 {
+    private static final String JMOD_PACKAGING = "jmod";
+
+    private static final String JMODS = "jmods";
+
+    private static final String JAR_PACKAGING = "jar";
+
     /**
      * <code>-G, --strip-debug</code> strip debug information.
      */
@@ -124,6 +136,9 @@ public class JLinkMojo
      */
     // TODO: is this a good final location?
     @Parameter( defaultValue = "${project.build.directory}/jlink" )
+    private File outputDirectoryImage;
+
+    @Parameter( defaultValue = "${project.build.directory}" )
     private File outputDirectory;
 
     /**
@@ -179,6 +194,30 @@ public class JLinkMojo
     @Parameter( defaultValue = "false" )
     private boolean verbose;
 
+    /**
+     * The JAR archiver needed for archiving the environments.
+     */
+    @Component( role = Archiver.class, hint = "zip" )
+    private ZipArchiver zipArchiver;
+
+    @Component
+    private ArchiverManager manager;
+
+    /**
+     * The kind of archive we should produce.
+     */
+    @Parameter( defaultValue = "zip", required = true )
+    private String archiveType;
+
+    @Component
+    private MavenProjectHelper projectHelper;
+
+    /**
+     * Name of the generated JAR.
+     */
+    @Parameter( defaultValue = "${project.build.finalName}", readonly = true )
+    private String finalName;
+
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
@@ -198,9 +237,9 @@ public class JLinkMojo
         // TODO: Find a more better and cleaner way?
         File jLinkExecuteable = new File( jLinkExec );
 
-        // Really Hacky...
+        // Really Hacky...do we have a better solution?
         File jLinkParent = jLinkExecuteable.getParentFile().getParentFile();
-        File jmodsFolder = new File( jLinkParent, "jmods" );
+        File jmodsFolder = new File( jLinkParent, JMODS );
 
         getLog().debug( " Parent: " + jLinkParent.getAbsolutePath() );
         getLog().debug( " jmodsFolder: " + jmodsFolder.getAbsolutePath() );
@@ -209,28 +248,80 @@ public class JLinkMojo
 
         deleteOutputDirectoryIfItAlreadyExists();
 
-        List<MavenProject> sortedProjects = getSession().getProjectDependencyGraph().getSortedProjects();
-        for ( MavenProject mavenProject : sortedProjects )
-        {
-            getLog().info( "MavenProject: " + mavenProject.getBasedir() );
-        }
-
         List<Dependency> dependencies = getSession().getCurrentProject().getDependencies();
 
         List<MavenProject> modulesToAdd = new ArrayList<>();
+        getLog().info( "The following dependencies will be linked into the runtime image:" );
         for ( Dependency dependency : dependencies )
         {
-            // Should we only take care of module which have packaging "jmod"
-            // what about other modules/packaging types like "jar" ?
-            if ( "jmod".equals( dependency.getType() ) )
+            // We will support "jmod" as well as "jar"
+            if ( JAR_PACKAGING.equals( dependency.getType() ) || JMOD_PACKAGING.equals( dependency.getType() ) )
             {
                 MavenProject mp = findDependencyInProjects( dependency );
+                getLog().info( " -> " + mp.getId() );
                 // TODO: What about module name != artifactId which has been
                 // defined in module-info.java file!
                 modulesToAdd.add( mp );
             }
         }
 
+        handleAddModules( modulesToAdd );
+
+        handleModulePath( jmodsFolder, modulesToAdd );
+
+        Commandline cmd;
+        try
+        {
+            cmd = createJLinkCommandLine();
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( e.getMessage() );
+        }
+        cmd.setExecutable( jLinkExec );
+
+        executeCommand( cmd, outputDirectoryImage );
+
+        File createZipArchiveFromImage = createZipArchiveFromImage( outputDirectory, outputDirectoryImage );
+
+        // Set main artifact.
+        getProject().getArtifact().setFile( createZipArchiveFromImage );
+        // artifact.setFile( createZipArchiveFromImage );
+        // getProject().setFile( createZipArchiveFromImage );
+        // packaging is something different than type..
+        // projectHelper.attachArtifact( getProject(), "image", "image", createZipArchiveFromImage );
+
+    }
+
+    private File createZipArchiveFromImage( File outputDirectory, File outputDirectoryImage )
+        throws MojoExecutionException
+    {
+        zipArchiver.addDirectory( outputDirectoryImage );
+
+        File resultArchive = getArchiveFile( outputDirectory, finalName, null, "zip" );
+
+        zipArchiver.setDestFile( resultArchive );
+        try
+        {
+            zipArchiver.createArchive();
+        }
+        catch ( ArchiverException e )
+        {
+            getLog().error( e.getMessage(), e );
+            throw new MojoExecutionException( e.getMessage(), e );
+        }
+        catch ( IOException e )
+        {
+            getLog().error( e.getMessage(), e );
+            throw new MojoExecutionException( e.getMessage(), e );
+        }
+
+        return resultArchive;
+
+    }
+
+    private void handleAddModules( List<MavenProject> modulesToAdd )
+    {
         if ( addModules == null )
         {
             addModules = new ArrayList<>();
@@ -238,38 +329,31 @@ public class JLinkMojo
 
         for ( MavenProject mavenProject : modulesToAdd )
         {
+            // TODO: Check if this is the correct way?
+            // This implies the artifactId is equal to moduleName.
             addModules.add( mavenProject.getArtifactId() );
         }
+    }
 
+    /**
+     * @param jmodsFolder The folder where to find the jmods of the JDK.
+     * @param modulesToAdd The modules to be added.
+     */
+    private void handleModulePath( File jmodsFolder, List<MavenProject> modulesToAdd )
+    {
         if ( modulePaths == null )
         {
             modulePaths = new ArrayList<>();
         }
 
-        // JDK mods folder
+        // The jmods directory of the JDK
         modulePaths.add( jmodsFolder.getAbsolutePath() );
 
         for ( MavenProject mavenProject : modulesToAdd )
         {
-            File output = new File( mavenProject.getBuild().getDirectory(), "jmods" );
+            File output = new File( mavenProject.getBuild().getDirectory(), JMODS );
             modulePaths.add( output.getAbsolutePath() );
         }
-
-        // Synopsis
-        // Usage: jlink <options> --module-path <modulepath> --add-modules <mods> --output <path>
-        Commandline cmd;
-        try
-        {
-            cmd = createJLinkCommandLine();
-        }
-        catch ( IOException e )
-        {
-            throw new MojoExecutionException( e.getMessage() );
-        }
-        cmd.setExecutable( jLinkExec );
-
-        executeCommand( cmd, outputDirectory );
-
     }
 
     private MavenProject findDependencyInProjects( Dependency dep )
@@ -315,28 +399,28 @@ public class JLinkMojo
     private void deleteOutputDirectoryIfItAlreadyExists()
         throws MojoExecutionException
     {
-        if ( outputDirectory.exists() )
+        if ( outputDirectoryImage.exists() )
         {
             // Delete the output folder of JLink before we start
             // otherwise JLink will fail with a message "Error: directory already exists: ..."
             try
             {
-                getLog().debug( "Deleting existing " + outputDirectory.getAbsolutePath() );
-                FileUtils.forceDelete( outputDirectory );
+                getLog().debug( "Deleting existing " + outputDirectoryImage.getAbsolutePath() );
+                FileUtils.forceDelete( outputDirectoryImage );
             }
             catch ( IOException e )
             {
                 getLog().error( "IOException", e );
-                throw new MojoExecutionException( "Failure during deletion of " + outputDirectory.getAbsolutePath()
+                throw new MojoExecutionException( "Failure during deletion of " + outputDirectoryImage.getAbsolutePath()
                     + " occured." );
             }
         }
     }
 
-    Commandline createJLinkCommandLine()
+    private Commandline createJLinkCommandLine()
         throws IOException
     {
-        File file = new File( outputDirectory.getParentFile(), "jlinkArgs" );
+        File file = new File( outputDirectoryImage.getParentFile(), "jlinkArgs" );
         if ( !getLog().isDebugEnabled() )
         {
             file.deleteOnExit();
@@ -388,23 +472,25 @@ public class JLinkMojo
             argsFile.println( "--no-man-pages" );
         }
 
-        if ( suggestProviders != null && !suggestProviders.isEmpty() )
+        if ( hasSuggestProviders() )
         {
             argsFile.println( "--suggest-providers" );
             StringBuilder sb = getCommaSeparatedList( suggestProviders );
             argsFile.println( sb.toString() );
         }
 
-        if ( limitModules != null && !limitModules.isEmpty() )
+        if ( hasLimitModules() )
         {
             argsFile.println( "--limit-modules" );
             StringBuilder sb = getCommaSeparatedList( limitModules );
             argsFile.println( sb.toString() );
         }
 
-        if ( addModules != null && !addModules.isEmpty() )
+        if ( hasModules() )
         {
             argsFile.println( "--add-modules" );
+            // This must be name of the module and *NOT* the name of the
+            // file!
             StringBuilder sb = getCommaSeparatedList( addModules );
             argsFile.println( sb.toString() );
         }
@@ -412,7 +498,7 @@ public class JLinkMojo
         if ( outputDirectory != null )
         {
             argsFile.println( "--output" );
-            argsFile.println( outputDirectory );
+            argsFile.println( outputDirectoryImage );
         }
 
         if ( verbose )
@@ -427,6 +513,21 @@ public class JLinkMojo
         return cmd;
     }
 
+    private boolean hasSuggestProviders()
+    {
+        return suggestProviders != null && !suggestProviders.isEmpty();
+    }
+
+    private boolean hasLimitModules()
+    {
+        return limitModules != null && !limitModules.isEmpty();
+    }
+
+    private boolean hasModules()
+    {
+        return addModules != null && !addModules.isEmpty();
+    }
+
     private String getColonSeparateList( List<String> modulePaths )
     {
         StringBuilder sb = new StringBuilder();

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 23/38: o Improved error message o Fixed command line options issue.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit db77cd5ebbf85a1b5bb13ce7f71e2c67a771d811
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Tue Sep 5 18:19:22 2017 +0000

    o Improved error message
    o Fixed command line options issue.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807384 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 122b859..98c7d5a 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -451,8 +451,8 @@ public class JLinkMojo
 
         if ( endian != null && ( !"big".equals( endian ) || !"little".equals( endian ) ) )
         {
-            String message =
-                "The given endian parameters " + endian + " is not in the valid value either 'little' or 'big'.";
+            String message = "The given endian parameter " + endian
+                + " does not contain one of the following values: 'little' or 'big'.";
             getLog().error( message );
             throw new MojoFailureException( message );
         }
@@ -504,7 +504,7 @@ public class JLinkMojo
 
         if ( endian != null )
         {
-            argsFile.println( "--bind-services" );
+            argsFile.println( "--endians" );
             argsFile.println( endian );
         }
         if ( ignoreSigningInformation )

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 07/38: Updated jlink command line options to be in line with the most recent version of jlink from JDK9+172. Added the following options: o --bind-services (bindServices) o --disable-plugin (disablePlugin) o --ignore-signing-information (ignoreSigningInformation) o --no-header-files (noHeaderFiles) o --no-man-pages (noManPages) o --suggest-providers (suggestProviders) o --verbose (verbose).

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 7727978cf65be8e20623d8530e357ecbe8e8b2c8
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Mon Jun 5 14:27:45 2017 +0000

    Updated jlink command line options to be in line
    with the most recent version of jlink from JDK9+172.
    Added the following options:
     o --bind-services (bindServices)
     o --disable-plugin (disablePlugin)
     o --ignore-signing-information (ignoreSigningInformation)
     o --no-header-files (noHeaderFiles)
     o --no-man-pages (noManPages)
     o --suggest-providers (suggestProviders)
     o --verbose (verbose).
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1797668 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  | 128 ++++++++++++++++++---
 1 file changed, 113 insertions(+), 15 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 70d4a14..a25f3e1 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -39,22 +39,42 @@ import org.codehaus.plexus.util.cli.Commandline;
 
 /**
  * <pre>
- * Usage: jlink &lt;options&gt; --module-path &lt;modulepath&gt; --add-modules &lt;mods&gt; --output &lt;path&gt;
+ * Usage: jlink &lt;options&gt; --module-path &lt;modulepath&gt; --add-modules &lt;module&gt;[,&lt;module&gt;...]
  * Possible options include:
- *  -h, --help                        Print this help message
- *  -p &lt;modulepath&gt;
- *  --module-path &lt;modulepath&gt;        Module path
- *  --limit-modules &lt;mod&gt;[,&lt;mod&gt;...]  Limit the universe of observable modules
- *  --add-modules &lt;mod&gt;[,&lt;mod&gt;...]    Root modules to resolve
- *  --output &lt;path&gt;                   Location of output path
- *  --endian &lt;little|big&gt;             Byte order of generated jimage (default:native)
- *  --version                         Version information
- *  --save-opts &lt;filename&gt;            Save jlink options in the given file
- *  -G, --strip-debug                 Strip debug information
- *  -c, --compress=&lt;0|1|2&gt;            Enable compression of resources (level 2)
- *  --plugin-module-path &lt;modulepath&gt; Custom plugin module path
- *  --list-plugins                    List available plugins
- *  &#64;&lt;filename&gt;                       Read options from file
+ *       --add-modules &lt;mod&gt;[,&lt;mod&gt;...]    Root modules to resolve
+ *       --bind-services                   Link in service provider modules and
+ *                                         their dependences
+ *   -c, --compress=&lt;0|1|2&gt;                Enable compression of resources:
+ *                                           Level 0: No compression
+ *                                           Level 1: Constant string sharing
+ *                                           Level 2: ZIP
+ *       --disable-plugin &lt;pluginname&gt;     Disable the plugin mentioned
+ *       --endian &lt;little|big&gt;             Byte order of generated jimage
+ *                                         (default:native)
+ *   -h, --help                            Print this help message
+ *       --ignore-signing-information      Suppress a fatal error when signed
+ *                                         modular JARs are linked in the image.
+ *                                         The signature related files of the
+ *                                         signed modular JARs are not copied to
+ *                                         the runtime image.
+ *       --launcher &lt;name&gt;=&lt;module&gt;[/&lt;mainclass&gt;]
+ *                                         Add a launcher command of the given
+ *                                         name for the module and the main class
+ *                                         if specified
+ *       --limit-modules &lt;mod&gt;[,&lt;mod&gt;...]  Limit the universe of observable
+ *                                         modules
+ *       --list-plugins                    List available plugins
+ *   -p, --module-path &lt;path&gt;              Module path
+ *       --no-header-files                 Exclude include header files
+ *       --no-man-pages                    Exclude man pages
+ *       --output &lt;path&gt;                   Location of output path
+ *       --save-opts &lt;filename&gt;            Save jlink options in the given file
+ *   -G, --strip-debug                     Strip debug information
+ *       --suggest-providers [&lt;name&gt;,...]  Suggest providers that implement the
+ *                                         given service types from the module path
+ *   -v, --verbose                         Enable verbose tracing
+ *       --version                         Version information
+ *       &#64;&lt;filename&gt;                       Read options from file
  * </pre>
  * 
  * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
@@ -117,6 +137,48 @@ public class JLinkMojo
     @Parameter( defaultValue = "${project.compileClasspathElements}", readonly = true, required = true )
     private List<String> modulePaths;
 
+    /**
+     * Add the option <code>--bind-services</code> or not.
+     */
+    @Parameter( defaultValue = "false" )
+    private boolean bindServices;
+
+    /**
+     * --disable-plugin pluginName.
+     */
+    @Parameter
+    private String disablePlugin;
+
+    /**
+     * <code>--ignore-signing-information</code>
+     */
+    @Parameter( defaultValue = "false" )
+    private boolean ignoreSigningInformation;
+
+    /**
+     * <code>--no-header-files</code>
+     */
+    @Parameter( defaultValue = "false" )
+    private boolean noHeaderFiles;
+
+    /**
+     * <code>--no-man-pages</code>
+     */
+    @Parameter( defaultValue = "false" )
+    private boolean noManPages;
+
+    /**
+     * --suggest-providers [<name>,...] Suggest providers that implement the given service types from the module path
+     */
+    @Parameter
+    private List<String> suggestProviders;
+
+    /**
+     * <code>--verbose</code>
+     */
+    @Parameter( defaultValue = "false" )
+    private boolean verbose;
+
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
@@ -289,18 +351,50 @@ public class JLinkMojo
             argsFile.println( "--strip-debug" );
         }
 
+        if ( bindServices )
+        {
+            argsFile.println( "--bind-services" );
+        }
+
+        if ( ignoreSigningInformation )
+        {
+            argsFile.println( "--ignore-signing-information" );
+        }
         if ( compression != null )
         {
             argsFile.println( "--compression" );
             argsFile.println( compression );
         }
 
+        if ( disablePlugin != null )
+        {
+            argsFile.println( "--disable-plugin" );
+            argsFile.append( '"' ).append( disablePlugin ).println( '"' );
+
+        }
         if ( modulePaths != null )
         {
             argsFile.println( "--module-path" );
             argsFile.append( '"' ).append( getColonSeparateList( modulePaths ).replace( "\\", "\\\\" ) ).println( '"' );
         }
 
+        if ( noHeaderFiles )
+        {
+            argsFile.println( "--no-header-files" );
+        }
+
+        if ( noManPages )
+        {
+            argsFile.println( "--no-man-pages" );
+        }
+
+        if ( suggestProviders != null && !suggestProviders.isEmpty() )
+        {
+            argsFile.println( "--suggest-providers" );
+            StringBuilder sb = getCommaSeparatedList( suggestProviders );
+            argsFile.println( sb.toString() );
+        }
+
         if ( limitModules != null && !limitModules.isEmpty() )
         {
             argsFile.println( "--limit-modules" );
@@ -321,6 +415,10 @@ public class JLinkMojo
             argsFile.println( outputDirectory );
         }
 
+        if ( verbose )
+        {
+            argsFile.println( "--verbose" );
+        }
         argsFile.close();
 
         Commandline cmd = new Commandline();

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 19/38: Fixed docs.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4a64d47e844708036381a089560e3adb4c89fe2f
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sun Sep 3 00:14:41 2017 +0000

    Fixed docs.
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807111 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  | 42 ++--------------------
 src/site/apt/index.apt.vm                          |  2 +-
 2 files changed, 3 insertions(+), 41 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 566a599..2a9f5a4 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -41,46 +41,8 @@ import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
 /**
- * The JLink goal is intended to create a Java Run Time Image file.
- * 
- * <pre>
- * Usage: jlink &lt;options&gt; --module-path &lt;modulepath&gt; --add-modules &lt;module&gt;[,&lt;module&gt;...]
- * Possible options include:
- *       --add-modules &lt;mod&gt;[,&lt;mod&gt;...]    Root modules to resolve
- *       --bind-services                   Link in service provider modules and
- *                                         their dependences
- *   -c, --compress=&lt;0|1|2&gt;                Enable compression of resources:
- *                                           Level 0: No compression
- *                                           Level 1: Constant string sharing
- *                                           Level 2: ZIP
- *       --disable-plugin &lt;pluginname&gt;     Disable the plugin mentioned
- *       --endian &lt;little|big&gt;             Byte order of generated jimage
- *                                         (default:native)
- *   -h, --help                            Print this help message
- *       --ignore-signing-information      Suppress a fatal error when signed
- *                                         modular JARs are linked in the image.
- *                                         The signature related files of the
- *                                         signed modular JARs are not copied to
- *                                         the runtime image.
- *       --launcher &lt;name&gt;=&lt;module&gt;[/&lt;mainclass&gt;]
- *                                         Add a launcher command of the given
- *                                         name for the module and the main class
- *                                         if specified
- *       --limit-modules &lt;mod&gt;[,&lt;mod&gt;...]  Limit the universe of observable
- *                                         modules
- *       --list-plugins                    List available plugins
- *   -p, --module-path &lt;path&gt;              Module path
- *       --no-header-files                 Exclude include header files
- *       --no-man-pages                    Exclude man pages
- *       --output &lt;path&gt;                   Location of output path
- *       --save-opts &lt;filename&gt;            Save jlink options in the given file
- *   -G, --strip-debug                     Strip debug information
- *       --suggest-providers [&lt;name&gt;,...]  Suggest providers that implement the
- *                                         given service types from the module path
- *   -v, --verbose                         Enable verbose tracing
- *       --version                         Version information
- *       &#64;&lt;filename&gt;                       Read options from file
- * </pre>
+ * The JLink goal is intended to create a Java Run Time Image file based on 
+ * {@link http://openjdk.java.net/jeps/282}, {@link http://openjdk.java.net/jeps/220}.
  * 
  * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
  */
diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm
index 9ddc41c..71ad63c 100644
--- a/src/site/apt/index.apt.vm
+++ b/src/site/apt/index.apt.vm
@@ -38,7 +38,7 @@ ${project.name}
 
   The JLink Plugin has two goals:
 
-  * {{{./jlink-mojo.html}jlink:jlink}} ....
+  * {{{./jlink-mojo.html}jlink:jlink}} create a Java Run Time Image from <<jar>>/<<jmod>> files.
 
   * {{{./help-mojo.html}jlink:help}} displays help information on maven-jlink-plugin.
 

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 29/38: [maven-release-plugin] prepare release maven-jlink-plugin-3.0.0-alpha-1

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit d06ab2931675a6ad6269e5db1e7e4832122b3853
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Sep 9 14:11:07 2017 +0000

    [maven-release-plugin] prepare release maven-jlink-plugin-3.0.0-alpha-1
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807905 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 450 ++++++++++++++++++++++++++++++++--------------------------------
 1 file changed, 224 insertions(+), 226 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5ffd7c1..7c15a84 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,226 +1,224 @@
-<?xml version='1.0' encoding='UTF-8'?>
-
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements. See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership. The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License. You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied. See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
->
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.maven.plugins</groupId>
-    <artifactId>maven-plugins</artifactId>
-    <version>30</version>
-    <relativePath>../maven-plugins/pom.xml</relativePath>
-  </parent>
-
-  <artifactId>maven-jlink-plugin</artifactId>
-  <version>3.0.0-SNAPSHOT</version>
-  <packaging>maven-plugin</packaging>
-
-  <name>Apache Maven JLink Plugin</name>
-  <description>The Maven JLink Plugin is intended to create Modular Run-Time Images.
-   http://openjdk.java.net/jeps/282, http://openjdk.java.net/jeps/220</description>
-  <inceptionYear>2016</inceptionYear>
-
-  <prerequisites>
-    <maven>${mavenVersion}</maven>
-  </prerequisites>
-
-  <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-jlink-plugin/</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-jlink-plugin/</developerConnection>
-    <url>http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jlink-plugin/</url>
-  </scm>
-
-  <issueManagement>
-    <system>jira</system>
-    <url>https://issues.apache.org/jira/browse/MJLINK</url>
-  </issueManagement>
-  <distributionManagement>
-    <site>
-      <id>apache.website</id>
-      <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/components/${maven.site.path}</url>
-    </site>
-  </distributionManagement>
-
-  <properties>
-    <mavenVersion>3.0</mavenVersion>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
-  </properties>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.maven.plugin-tools</groupId>
-      <artifactId>maven-plugin-annotations</artifactId>
-      <version>3.5</version>
-      <scope>provided</scope>
-    </dependency>
-    <!-- Maven -->
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-api</artifactId>
-      <version>${mavenVersion}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-core</artifactId>
-      <version>${mavenVersion}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-archiver</artifactId>
-      <version>3.2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-archiver</artifactId>
-      <version>3.5</version>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-java</artifactId>
-      <version>0.9.3</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-lang3</artifactId>
-      <version>3.6</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.12</version>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
-      <version>1.10.19</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.assertj</groupId>
-      <artifactId>assertj-core</artifactId>
-      <version>1.7.1</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-invoker-plugin</artifactId>
-          <version>3.0.0</version>
-        </plugin>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-site-plugin</artifactId>
-          <version>3.6</version>
-        </plugin>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-javadoc-plugin</artifactId>
-          <version>3.0.0-M1</version>
-        </plugin>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-plugin-plugin</artifactId>
-          <version>3.5</version>
-        </plugin>
-
-        <plugin>
-          <artifactId>maven-enforcer-plugin</artifactId>
-          <version>3.0.0-M1</version>
-          <executions>
-            <execution>
-              <id>enforce-bytecode-version</id>
-              <configuration>
-                <rules>
-                  <enforceBytecodeVersion>
-                    <maxJdkVersion>1.7</maxJdkVersion>
-                    <excludes>
-                      <exclude>org.ow2.asm:asm</exclude>
-                    </excludes>
-                  </enforceBytecodeVersion>
-                  <requireSameVersions />
-                </rules>
-              </configuration>
-            </execution>
-          </executions>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-    <resources>
-      <resource>
-        <directory>src/main/filtered-resources</directory>
-        <filtering>true</filtering>
-      </resource>
-    </resources>
-  </build>
-
-  <reporting>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-plugin-plugin</artifactId>
-        <version>3.5</version>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-invoker-plugin</artifactId>
-        <version>3.0.0</version>
-      </plugin>
-    </plugins>
-  </reporting>
-  <profiles>
-    <profile>
-      <id>run-its</id>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-invoker-plugin</artifactId>
-            <configuration>
-              <goals>
-                <goal>clean</goal>
-                <goal>package</goal>
-              </goals>
-            </configuration>
-            <executions>
-              <execution>
-                <id>integration-test</id>
-                <goals>
-                  <goal>install</goal>
-                  <goal>integration-test</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-
-</project>
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.plugins</groupId>
+    <artifactId>maven-plugins</artifactId>
+    <version>30</version>
+    <relativePath>../maven-plugins/pom.xml</relativePath>
+  </parent>
+
+  <artifactId>maven-jlink-plugin</artifactId>
+  <version>3.0.0-alpha-1</version>
+  <packaging>maven-plugin</packaging>
+
+  <name>Apache Maven JLink Plugin</name>
+  <description>The Maven JLink Plugin is intended to create Modular Run-Time Images.
+   http://openjdk.java.net/jeps/282, http://openjdk.java.net/jeps/220</description>
+  <inceptionYear>2016</inceptionYear>
+
+  <prerequisites>
+    <maven>${mavenVersion}</maven>
+  </prerequisites>
+
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-jlink-plugin-3.0.0-alpha-1</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-jlink-plugin-3.0.0-alpha-1</developerConnection>
+    <url>http://svn.apache.org/viewvc/maven/plugins/tags/maven-jlink-plugin-3.0.0-alpha-1</url>
+  </scm>
+
+  <issueManagement>
+    <system>jira</system>
+    <url>https://issues.apache.org/jira/browse/MJLINK</url>
+  </issueManagement>
+  <distributionManagement>
+    <site>
+      <id>apache.website</id>
+      <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/components/${maven.site.path}</url>
+    </site>
+  </distributionManagement>
+
+  <properties>
+    <mavenVersion>3.0</mavenVersion>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.plugin-tools</groupId>
+      <artifactId>maven-plugin-annotations</artifactId>
+      <version>3.5</version>
+      <scope>provided</scope>
+    </dependency>
+    <!-- Maven -->
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>${mavenVersion}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <version>${mavenVersion}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-archiver</artifactId>
+      <version>3.2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-archiver</artifactId>
+      <version>3.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-java</artifactId>
+      <version>0.9.3</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+      <version>3.6</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.12</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <version>1.10.19</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <version>1.7.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-invoker-plugin</artifactId>
+          <version>3.0.0</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>3.6</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>3.0.0-M1</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-plugin-plugin</artifactId>
+          <version>3.5</version>
+        </plugin>
+
+        <plugin>
+          <artifactId>maven-enforcer-plugin</artifactId>
+          <version>3.0.0-M1</version>
+          <executions>
+            <execution>
+              <id>enforce-bytecode-version</id>
+              <configuration>
+                <rules>
+                  <enforceBytecodeVersion>
+                    <maxJdkVersion>1.7</maxJdkVersion>
+                    <excludes>
+                      <exclude>org.ow2.asm:asm</exclude>
+                    </excludes>
+                  </enforceBytecodeVersion>
+                  <requireSameVersions />
+                </rules>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <resources>
+      <resource>
+        <directory>src/main/filtered-resources</directory>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
+  </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-plugin-plugin</artifactId>
+        <version>3.5</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-invoker-plugin</artifactId>
+        <version>3.0.0</version>
+      </plugin>
+    </plugins>
+  </reporting>
+  <profiles>
+    <profile>
+      <id>run-its</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-invoker-plugin</artifactId>
+            <configuration>
+              <goals>
+                <goal>clean</goal>
+                <goal>package</goal>
+              </goals>
+            </configuration>
+            <executions>
+              <execution>
+                <id>integration-test</id>
+                <goals>
+                  <goal>install</goal>
+                  <goal>integration-test</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
+</project>

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 06/38: Reformatted code.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e17066919f9514a18cddb64abafa8873d16e8424
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Mon Jun 5 12:54:41 2017 +0000

    Reformatted code.
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1797659 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  | 38 ++++++----------------
 1 file changed, 10 insertions(+), 28 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 27cb106..70d4a14 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -20,26 +20,6 @@ package org.apache.maven.plugins.jlink;
  */
 
 import java.io.File;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.ArrayList;
@@ -122,6 +102,7 @@ public class JLinkMojo
      * <code>--output &lt;path&gt;</code>
      * </p>
      */
+    // TODO: is this a good final location?
     @Parameter( defaultValue = "${project.build.directory}/jlink" )
     private File outputDirectory;
 
@@ -177,6 +158,8 @@ public class JLinkMojo
         List<MavenProject> modulesToAdd = new ArrayList<>();
         for ( Dependency dependency : dependencies )
         {
+            // Should we only take care of module which have packaging "jmod"
+            // what about other modules/packaging types like "jar" ?
             if ( "jmod".equals( dependency.getType() ) )
             {
                 MavenProject mp = findDependencyInProjects( dependency );
@@ -190,7 +173,7 @@ public class JLinkMojo
         {
             addModules = new ArrayList<>();
         }
-        
+
         for ( MavenProject mavenProject : modulesToAdd )
         {
             addModules.add( mavenProject.getArtifactId() );
@@ -288,7 +271,8 @@ public class JLinkMojo
         }
     }
 
-    Commandline createJLinkCommandLine() throws IOException
+    Commandline createJLinkCommandLine()
+        throws IOException
     {
         File file = new File( outputDirectory.getParentFile(), "jlinkArgs" );
         if ( !getLog().isDebugEnabled() )
@@ -297,9 +281,9 @@ public class JLinkMojo
         }
         file.getParentFile().mkdirs();
         file.createNewFile();
-        
+
         PrintStream argsFile = new PrintStream( file );
-        
+
         if ( stripDebug )
         {
             argsFile.println( "--strip-debug" );
@@ -314,9 +298,7 @@ public class JLinkMojo
         if ( modulePaths != null )
         {
             argsFile.println( "--module-path" );
-            argsFile.append( '"' )
-                    .append( getColonSeparateList( modulePaths ).replace( "\\", "\\\\" ) )
-                    .println( '"' );
+            argsFile.append( '"' ).append( getColonSeparateList( modulePaths ).replace( "\\", "\\\\" ) ).println( '"' );
         }
 
         if ( limitModules != null && !limitModules.isEmpty() )
@@ -338,7 +320,7 @@ public class JLinkMojo
             argsFile.println( "--output" );
             argsFile.println( outputDirectory );
         }
-        
+
         argsFile.close();
 
         Commandline cmd = new Commandline();

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 25/38: [MJLINK-1] Upgrade several plugins to get a working site generation o Upgraded maven-invoker-plugin, maven-site-plugin maven-javadoc-plugin also in reporting sections.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 201673f11b493f69e693807783499968f06b49b8
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Wed Sep 6 19:45:32 2017 +0000

    [MJLINK-1] Upgrade several plugins to get a working site generation
     o Upgraded maven-invoker-plugin, maven-site-plugin
       maven-javadoc-plugin also in reporting sections.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807521 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/pom.xml b/pom.xml
index 982237a..d291e12 100644
--- a/pom.xml
+++ b/pom.xml
@@ -71,6 +71,7 @@
     <dependency>
       <groupId>org.apache.maven.plugin-tools</groupId>
       <artifactId>maven-plugin-annotations</artifactId>
+      <version>3.5</version>
       <scope>provided</scope>
     </dependency>
     <!-- Maven -->
@@ -130,12 +131,28 @@
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-invoker-plugin</artifactId>
+          <version>3.0.0</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>3.6</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>3.0.0-M1</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-plugin-plugin</artifactId>
           <version>3.5</version>
         </plugin>
 
         <plugin>
           <artifactId>maven-enforcer-plugin</artifactId>
+          <version>3.0.0-M1</version>
           <executions>
             <execution>
               <id>enforce-bytecode-version</id>
@@ -162,4 +179,19 @@
       </resource>
     </resources>
   </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-plugin-plugin</artifactId>
+        <version>3.5</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-invoker-plugin</artifactId>
+        <version>3.0.0</version>
+      </plugin>
+    </plugins>
+  </reporting>
 </project>

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 13/38: Added basic site information. Addded parameter documentation. Added some unit tests for methods in AbstractJLinkMojo

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 71506365ae4255a7166abd91ad8a2ceaf5a7d2fc
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Sep 2 14:34:35 2017 +0000

    Added basic site information.
    Addded parameter documentation.
    Added some unit tests for methods in AbstractJLinkMojo
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807049 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  12 ++
 .../maven/plugins/jlink/AbstractJLinkMojo.java     |  70 +++++++-
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  | 178 ++++++++++++---------
 src/site/apt/index.apt.vm                          |  72 +++++++++
 src/site/apt/usage.apt.vm                          |  58 +++++++
 src/site/resources/download.cgi                    |  22 +++
 src/site/site.xml                                  |  44 +++++
 .../maven/plugins/jlink/AbsractJLinkMojoTest.java  | 109 +++++++++++++
 8 files changed, 486 insertions(+), 79 deletions(-)

diff --git a/pom.xml b/pom.xml
index 03d1bb7..95114d0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -118,6 +118,18 @@
       <scope>test</scope>
     </dependency>
 
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <version>1.10.19</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <version>1.7.1</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
diff --git a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
index 70f2860..9c5bab7 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
@@ -77,7 +77,7 @@ public abstract class AbstractJLinkMojo
             jLinkExecutable = tc.findTool( "jlink" );
         }
 
-        //TODO: Check if there exist a more elegant way?
+        // TODO: Check if there exist a more elegant way?
         String jLinkCommand = "jlink" + ( SystemUtils.IS_OS_WINDOWS ? ".exe" : "" );
 
         File jLinkExe;
@@ -121,8 +121,8 @@ public abstract class AbstractJLinkMojo
             {
                 throw new IOException( "The environment variable JAVA_HOME is not correctly set." );
             }
-            if ( ( !new File( javaHome ).getCanonicalFile().exists() )
-                || ( new File( javaHome ).getCanonicalFile().isFile() ) )
+            if ( !new File( javaHome ).getCanonicalFile().exists()
+                || new File( javaHome ).getCanonicalFile().isFile() )
             {
                 throw new IOException( "The environment variable JAVA_HOME=" + javaHome
                     + " doesn't exist or is not a valid directory." );
@@ -257,6 +257,7 @@ public abstract class AbstractJLinkMojo
      * @param basedir the output directory
      * @param finalName the name of the ear file
      * @param classifier an optional classifier
+     * @param archiveExt The extension of the file.
      * @return the file to generate
      */
     protected File getArchiveFile( File basedir, String finalName, String classifier, String archiveExt )
@@ -307,4 +308,67 @@ public abstract class AbstractJLinkMojo
         return result;
     }
 
+    /**
+     * This will convert a module path separated by either {@code :} or {@code ;} into a string which uses the platform
+     * depend path separator uniformly.
+     * 
+     * @param pluginModulePath The module path.
+     * @return The platform separated module path.
+     */
+    protected StringBuilder convertSeparatedModulePathToPlatformSeparatedModulePath( String pluginModulePath )
+    {
+        StringBuilder sb = new StringBuilder();
+        // Split the module path by either ":" or ";" linux/windows path separator and
+        // convert uniformly to the platform used separator.
+        String[] splitModule = pluginModulePath.split( "[;:]" );
+        for ( String module : splitModule )
+        {
+            if ( sb.length() > 0 )
+            {
+                sb.append( File.pathSeparatorChar );
+            }
+            sb.append( module );
+        }
+        return sb;
+    }
+
+    /**
+     * Convert a list into a string which is separated by platform depend path separator.
+     * 
+     * @param modulePaths The list of elements.
+     * @return The string which contains the elements separated by {@link File#pathSeparatorChar}.
+     */
+    protected String getPlatformDependSeparateList( List<String> modulePaths )
+    {
+        StringBuilder sb = new StringBuilder();
+        for ( String module : modulePaths )
+        {
+            if ( sb.length() > 0 )
+            {
+                sb.append( File.pathSeparatorChar );
+            }
+            sb.append( module );
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Convert a list into a 
+     * @param modules The list of modules.
+     * @return The string with the module list which is separated by {@code ,}.
+     */
+    protected String getCommaSeparatedList( List<String> modules )
+    {
+        StringBuilder sb = new StringBuilder();
+        for ( String module : modules )
+        {
+            if ( sb.length() > 0 )
+            {
+                sb.append( ',' );
+            }
+            sb.append( module );
+        }
+        return sb.toString();
+    }
+
 }
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 62334b9..a8b7bf3 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -34,10 +34,8 @@ import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectHelper;
 import org.codehaus.plexus.archiver.Archiver;
 import org.codehaus.plexus.archiver.ArchiverException;
-import org.codehaus.plexus.archiver.manager.ArchiverManager;
 import org.codehaus.plexus.archiver.zip.ZipArchiver;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.cli.Commandline;
@@ -84,9 +82,7 @@ import org.codehaus.plexus.util.cli.Commandline;
  * 
  * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
  */
-// TODO: Think if ResultionScope is needed here? May be we need to reconsider package phase?
-// May be it would be wise to put into PREPARE-PACKAGE and the generation of the final jimage in the package phase?
-// Furthermore It could make sense so we can change the conf files if needed...
+// TODO: Check things about conf files?
 // CHECKSTYLE_OFF: LineLength
 @Mojo( name = "jlink", requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME, defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true )
 // CHECKSTYLE_ON: LineLength
@@ -100,53 +96,83 @@ public class JLinkMojo
     private static final String JAR_PACKAGING = "jar";
 
     /**
+     * This is intended to strip debug information out. The command line equivalent of <code>jlink</code> is:
      * <code>-G, --strip-debug</code> strip debug information.
      */
     @Parameter( defaultValue = "false" )
     private boolean stripDebug;
 
     /**
-     * <code>-c, --compress=&lt;0|1|2&gt;</code> Enabled compression of resources.
+     * Here you can define the compression of the resources being used. The command line equivalent is:
+     * <code>-c, --compress=&lt;0|1|2&gt;</code>.
      */
     @Parameter
     private Integer compression;
 
     /**
-     * Limit the universe of observable modules. <code>--limit-modules &lt;mod&gt;[,&lt;mod&gt;...]</code>
+     * Limit the universe of observable modules. The following gives an example of the configuration which can be used
+     * in the <code>pom.xml</code> file.
+     * 
+     * <pre>
+     *   &lt;limitModules&gt;
+     *     &lt;limitModule&gt;mod1&lt;/limitModule&gt;
+     *     &lt;limitModule&gt;xyz&lt;/limitModule&gt;
+     *     .
+     *     .
+     *   &lt;/limitModules&gt;
+     * </pre>
+     * 
+     * This configuration is the equivalent of the command line option:
+     * <code>--limit-modules &lt;mod&gt;[,&lt;mod&gt;...]</code>
      */
     @Parameter
     private List<String> limitModules;
 
     /**
-     * Root modules to resolve. <code>--add-modules &lt;mod&gt;[,&lt;mod&gt;...]</code>
+     * By using the --add-modules you can define the root modules to be resolved. The configuration in
+     * <code>pom.xml</code> file can look like this:
+     * 
+     * <pre>
+     * &lt;addModules&gt;
+     *   &lt;addModule&gt;mod1&lt;/addModule&gt;
+     *   &lt;addModule&gt;first&lt;/addModule&gt;
+     *   .
+     *   .
+     * &lt;/addModules&gt;
+     * </pre>
+     * 
+     * The command line equivalent for jlink is: <code>--add-modules &lt;mod&gt;[,&lt;mod&gt;...]</code>.
      */
     @Parameter
     private List<String> addModules;
 
     /**
-     * Custom plugin module path <code>--plugin-module-path &lt;modulepath&gt;</code>
+     * Define the plugin module path to be used. There can be defined multiple entries separated by either {@code ;} or
+     * {@code :}. The jlink command line equivalent is: <code>--plugin-module-path &lt;modulepath&gt;</code>
      */
     @Parameter
-    private File pluginModulePath;
+    private String pluginModulePath;
 
     /**
+     * The output directory for the resulting Run Time Image. This is stored in non compressed form.
      * <code>--output &lt;path&gt;</code>
-     * </p>
      */
     // TODO: is this a good final location?
     @Parameter( defaultValue = "${project.build.directory}/jlink" )
     private File outputDirectoryImage;
 
-    @Parameter( defaultValue = "${project.build.directory}" )
+    @Parameter( defaultValue = "${project.build.directory}", required = true, readonly = true )
     private File outputDirectory;
 
     /**
-     * Byte order of generated jimage (default:native). <code>--endian &lt;little|big&gt;</code>.
-     * </p>
+     * The byte order of the generated Java Run Time image. <code>--endian &lt;little|big&gt;</code>. If the endian is
+     * not given the default is: <code>native</code>.
      */
-    @Parameter( defaultValue = "native" )
+    // TODO: Should we define either little or big as default? or should we left as it.
+    @Parameter
     private String endian;
 
+    // TODO: Check if we should allow to extend the modulePaths by manual additions in the pom file?
     @Parameter( defaultValue = "${project.compileClasspathElements}", readonly = true, required = true )
     private List<String> modulePaths;
 
@@ -157,7 +183,7 @@ public class JLinkMojo
     private boolean bindServices;
 
     /**
-     * --disable-plugin pluginName.
+     * You can disable a plugin by using this option. <code>--disable-plugin pluginName</code>.
      */
     @Parameter
     private String disablePlugin;
@@ -181,13 +207,24 @@ public class JLinkMojo
     private boolean noManPages;
 
     /**
-     * --suggest-providers [<name>,...] Suggest providers that implement the given service types from the module path
+     * Suggest providers that implement the given service types from the module path.
+     * 
+     * <pre>
+     * &lt;suggestProviders&gt;
+     *   &lt;suggestProvider&gt;name-a&lt;/suggestProvider&gt;
+     *   &lt;suggestProvider&gt;name-b&lt;/suggestProvider&gt;
+     *   .
+     *   .
+     * &lt;/suggestProviders&gt;
+     * </pre>
+     * 
+     * The jlink command linke equivalent: <code>--suggest-providers [&lt;name&gt;,...]</code>
      */
     @Parameter
     private List<String> suggestProviders;
 
     /**
-     * <code>--verbose</code>
+     * This will turn on verbose mode. The jlink command line equivalent is: <code>--verbose</code>
      */
     @Parameter( defaultValue = "false" )
     private boolean verbose;
@@ -198,20 +235,8 @@ public class JLinkMojo
     @Component( role = Archiver.class, hint = "zip" )
     private ZipArchiver zipArchiver;
 
-    @Component
-    private ArchiverManager manager;
-
     /**
-     * The kind of archive we will produce.
-     */
-    @Parameter( defaultValue = "zip", required = true )
-    private String archiveType;
-
-    @Component
-    private MavenProjectHelper projectHelper;
-
-    /**
-     * Name of the generated JAR.
+     * Name of the generated ZIP file.
      */
     @Parameter( defaultValue = "${project.build.finalName}", readonly = true )
     private String finalName;
@@ -241,22 +266,25 @@ public class JLinkMojo
         List<Dependency> dependencies = getSession().getCurrentProject().getDependencies();
 
         List<MavenProject> modulesToAdd = new ArrayList<>();
-        if ( dependencies.isEmpty() )
-        {
-            
-        }
+//        if ( dependencies.isEmpty() )
+//        {
+//            // Do we need to do something if no dependencies have been defined ?
+//            // WARNING ?
+//        }
         getLog().info( "The following dependencies will be linked into the runtime image:" );
         for ( Dependency dependency : dependencies )
         {
             // We will support "jmod" as well as "jar"
-            // TODO: Think about jmod's cause they can contain config files etc. ? What todo with them?
+            // TODO: Think about jmod's cause they can contain config files etc. ? What todo with them? Are they already
+            // handled by jlink ? 
             if ( JAR_PACKAGING.equals( dependency.getType() ) || JMOD_PACKAGING.equals( dependency.getType() ) )
             {
                 MavenProject mp = findDependencyInProjects( dependency );
                 getLog().info( " -> " + mp.getId() );
                 // TODO: What about module name != artifactId which has been
                 // defined in module-info.java file!
-                // This would mean to read the module-info information from the jmod file for example...
+                // This would mean to read the module-info information from the jmod/jar file for example to 
+                // get the appropriate information.
                 modulesToAdd.add( mp );
             }
         }
@@ -350,11 +378,11 @@ public class JLinkMojo
             addModules = new ArrayList<>();
         }
 
-        for ( MavenProject mavenProject : modulesToAdd )
+        for ( MavenProject module : modulesToAdd )
         {
             // TODO: Check if this is the correct way?
-            // This implies the artifactId is equal to moduleName.
-            addModules.add( mavenProject.getArtifactId() );
+            // This implies the artifactId is equal to moduleName which might not always be the case!
+            addModules.add( module.getArtifactId() );
         }
     }
 
@@ -406,6 +434,14 @@ public class JLinkMojo
             throw new MojoFailureException( message );
         }
 
+        if ( endian != null && ( !"big".equals( endian ) || !"little".equals( endian ) ) )
+        {
+            String message =
+                "The given endian parameters " + endian + " is not in the valid value either 'little' or 'big'.";
+            getLog().error( message );
+            throw new MojoFailureException( message );
+        }
+
         // CHECK if this assumption here is correct?
         // if ( modulePaths != null && ( !modulePaths.isEmpty() ) )
         // {
@@ -463,6 +499,11 @@ public class JLinkMojo
             argsFile.println( "--bind-services" );
         }
 
+        if ( endian != null )
+        {
+            argsFile.println( "--bind-services" );
+            argsFile.println( endian );
+        }
         if ( ignoreSigningInformation )
         {
             argsFile.println( "--ignore-signing-information" );
@@ -481,8 +522,14 @@ public class JLinkMojo
         }
         if ( modulePaths != null )
         {
+            //@formatter:off
             argsFile.println( "--module-path" );
-            argsFile.append( '"' ).append( getColonSeparateList( modulePaths ).replace( "\\", "\\\\" ) ).println( '"' );
+            argsFile
+              .append( '"' )
+              .append( getPlatformDependSeparateList( modulePaths )
+                         .replace( "\\", "\\\\" ) 
+                     ).println( '"' );
+            //@formatter:off
         }
 
         if ( noHeaderFiles )
@@ -498,24 +545,31 @@ public class JLinkMojo
         if ( hasSuggestProviders() )
         {
             argsFile.println( "--suggest-providers" );
-            StringBuilder sb = getCommaSeparatedList( suggestProviders );
-            argsFile.println( sb.toString() );
+            String sb = getCommaSeparatedList( suggestProviders );
+            argsFile.println( sb );
         }
 
         if ( hasLimitModules() )
         {
             argsFile.println( "--limit-modules" );
-            StringBuilder sb = getCommaSeparatedList( limitModules );
-            argsFile.println( sb.toString() );
+            String sb = getCommaSeparatedList( limitModules );
+            argsFile.println( sb );
         }
 
         if ( hasModules() )
         {
             argsFile.println( "--add-modules" );
             // This must be name of the module and *NOT* the name of the
-            // file!
-            StringBuilder sb = getCommaSeparatedList( addModules );
-            argsFile.println( sb.toString() );
+            // file! Can we somehow pre check this information to fail early?
+            String sb = getCommaSeparatedList( addModules );
+            argsFile.append( '"' ).append( sb.replace( "\\", "\\\\" ) ).println( '"' );
+        }
+
+        if ( pluginModulePath != null )
+        {
+            argsFile.println( "--plugin-module-path" );
+            StringBuilder sb = convertSeparatedModulePathToPlatformSeparatedModulePath( pluginModulePath );
+            argsFile.append( '"' ).append( sb.toString().replace( "\\", "\\\\" ) ).println( '"' );
         }
 
         if ( outputDirectory != null )
@@ -550,32 +604,4 @@ public class JLinkMojo
     {
         return addModules != null && !addModules.isEmpty();
     }
-
-    private String getColonSeparateList( List<String> modulePaths )
-    {
-        StringBuilder sb = new StringBuilder();
-        for ( String module : modulePaths )
-        {
-            if ( sb.length() > 0 )
-            {
-                sb.append( File.pathSeparator );
-            }
-            sb.append( module );
-        }
-        return sb.toString();
-    }
-
-    private StringBuilder getCommaSeparatedList( List<String> modules )
-    {
-        StringBuilder sb = new StringBuilder();
-        for ( String module : modules )
-        {
-            if ( sb.length() > 0 )
-            {
-                sb.append( ',' );
-            }
-            sb.append( module );
-        }
-        return sb;
-    }
 }
diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm
new file mode 100644
index 0000000..9ddc41c
--- /dev/null
+++ b/src/site/apt/index.apt.vm
@@ -0,0 +1,72 @@
+  ------
+  Introduction
+  ------
+  Karl Heinz Marbaise
+  ------
+  2017-08-17
+  ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License.  You may obtain a copy of the License at
+~~
+~~   http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied.  See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+${project.name}
+
+  The JLink Plugin is intended to create a {{{http://openjdk.java.net/jeps/220}Modular Run-Time Images}}
+  via {{{http://openjdk.java.net/jeps/282}jlink}}.
+    
+  NOTE: This is an alpha release which means everything can change until we reach the first
+  milestone release.
+
+* Goals Overview
+
+  The JLink Plugin has two goals:
+
+  * {{{./jlink-mojo.html}jlink:jlink}} ....
+
+  * {{{./help-mojo.html}jlink:help}} displays help information on maven-jlink-plugin.
+
+  []
+
+* Usage
+
+  General instructions on how to use the JLink Plugin can be found on the {{{./usage.html}usage page}}. Some more
+  specific use cases are described in the examples given below.
+
+  In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel
+  free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could
+  already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching
+  the {{{./mail-lists.html}mail archive}}.
+
+  If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our
+  {{{./issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your
+  concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason,
+  entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated.
+  Of course, patches are welcome, too. Contributors can check out the project from our
+  {{{./source-repository.html}source repository}} and will find supplementary information in the
+  {{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}.
+
+* Examples
+
+  To provide you with better understanding on some usages of the Maven JLink Plugin,
+  you can take a look into the following examples:
+
+  TODO: Add examples.
+
+  []
diff --git a/src/site/apt/usage.apt.vm b/src/site/apt/usage.apt.vm
new file mode 100644
index 0000000..da798de
--- /dev/null
+++ b/src/site/apt/usage.apt.vm
@@ -0,0 +1,58 @@
+  ------
+  Usage
+  ------
+  Karl Heinz Marbaise <kh...@apache.org>
+  ------
+  2017-09-01
+
+~~ Copyright 2006 The Apache Software Foundation.
+~~
+~~ Licensed under the Apache License, Version 2.0 (the "License");
+~~ you may not use this file except in compliance with the License.
+~~ You may obtain a copy of the License at
+~~
+~~      http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+
+Usage
+
+* Introduction
+
+  The Maven JLink Pluing will be used to create a Java Run-Time Image.
+  
+* Configuring the JLink Plugin
+
+  The configuration of the JLink Plugin is a bit different from the configuration
+  of any other plugin. The configuration should look like this:
+
++-----
+<project>
+  [...]
+  <build>
+    [...]
+    <plugins>
+      [...]
+      <plugin>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>${project.version}</version>
+        <extensions>true</extensions>
+        <configuration>
+          <!-- configuration elements goes here -->
+        </configuration>
+      </plugin>
+   [...]
+</project>
++-----
+
+  The configuration elements contains the configuration for the plugin like
+  other Maven plugins.
+  
diff --git a/src/site/resources/download.cgi b/src/site/resources/download.cgi
new file mode 100644
index 0000000..1b178d2
--- /dev/null
+++ b/src/site/resources/download.cgi
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# Just call the standard mirrors.cgi script. It will use download.html
+# as the input template.
+exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $*
\ No newline at end of file
diff --git a/src/site/site.xml b/src/site/site.xml
new file mode 100644
index 0000000..46b5468
--- /dev/null
+++ b/src/site/site.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd"
+>
+  <custom>
+    <fluidoSkin>
+      <profile>pre-release</profile>
+    </fluidoSkin>
+  </custom>
+  <body>
+    <menu name="Overview">
+      <item name="Introduction" href="index.html" />
+      <item name="Goals" href="plugin-info.html" />
+      <item name="Usage" href="usage.html" />
+      <!-- <item name="FAQ" href="faq.html"/> -->
+      <!-- According to https://issues.apache.org/jira/browse/MNGSITE-152 -->
+      <item name="License" href="http://www.apache.org/licenses/" />
+      <item name="Download" href="download.html" />
+    </menu>
+    <!-- <menu name="Examples"> -->
+    <!-- <item name="Basic multi module setup" href="examples/base-jlink-example.html"/> -->
+    <!-- </menu> -->
+  </body>
+</project>
diff --git a/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java b/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java
new file mode 100644
index 0000000..bfdf603
--- /dev/null
+++ b/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java
@@ -0,0 +1,109 @@
+package org.apache.maven.plugins.jlink;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collections;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+/**
+ * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
+ */
+public class AbsractJLinkMojoTest
+{
+    private AbstractJLinkMojo mojoMock;
+
+    @Before
+    public void before()
+    {
+        this.mojoMock = mock( AbstractJLinkMojo.class, Mockito.CALLS_REAL_METHODS );
+    }
+
+    @Test
+    public void convertShouldReturnSingleCharacter()
+    {
+        StringBuilder result = mojoMock.convertSeparatedModulePathToPlatformSeparatedModulePath( "x" );
+        assertThat( result.toString() ).isNotEmpty().isEqualTo( "x" );
+    }
+
+    @Test
+    public void convertShouldReturnTwoCharactersSeparatedByPathSeparator()
+    {
+        StringBuilder result = mojoMock.convertSeparatedModulePathToPlatformSeparatedModulePath( "x;a" );
+        assertThat( result.toString() ).isEqualTo( "x" + File.pathSeparatorChar + "a" );
+    }
+
+    @Test
+    public void convertUsingDifferentDelimiterShouldReturnTwoCharactersSeparatedByPathSeparator()
+    {
+        StringBuilder result = mojoMock.convertSeparatedModulePathToPlatformSeparatedModulePath( "x:a" );
+        assertThat( result.toString() ).isEqualTo( "x" + File.pathSeparatorChar + "a" );
+    }
+
+    @Test
+    public void convertUsingMultipleDelimitersShouldReturnTwoCharactersSeparatedByPathSeparator()
+    {
+        StringBuilder result = mojoMock.convertSeparatedModulePathToPlatformSeparatedModulePath( "x:a::" );
+        assertThat( result.toString() ).isEqualTo( "x" + File.pathSeparatorChar + "a" );
+    }
+
+    @Test
+    public void getPlatformDependSeparateListShouldReturnASingleCharacter()
+    {
+        String result = mojoMock.getPlatformDependSeparateList( Collections.singletonList( "A" ) );
+        assertThat( result ).isEqualTo( "A" );
+    }
+
+    @Test
+    public void getPlatformDependSeparateListShouldReturnTwoCharactersSeparated()
+    {
+        String result = mojoMock.getPlatformDependSeparateList( Arrays.asList( "A", "B" ) );
+        assertThat( result ).isEqualTo( "A" + File.pathSeparatorChar + "B" );
+    }
+
+    @Test
+    public void getPlatformDependSeparateListShouldReturnThreeCharactersSeparated()
+    {
+        String result = mojoMock.getPlatformDependSeparateList( Arrays.asList( "A", "B", "C" ) );
+        assertThat( result ).isEqualTo( "A" + File.pathSeparatorChar + "B" + File.pathSeparatorChar + "C" );
+    }
+
+    @Test
+    public void getCommaSeparatedListShouldReturnASingleCharacter()
+    {
+        String result = mojoMock.getCommaSeparatedList( Arrays.asList( "A" ) );
+        assertThat( result ).isEqualTo( "A" );
+    }
+
+    @Test
+    public void getCommaSeparatedListShouldReturnTwoCharactersSeparatedByComma()
+    {
+        String result = mojoMock.getCommaSeparatedList( Arrays.asList( "A", "B" ) );
+        assertThat( result ).isEqualTo( "A,B" );
+    }
+
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 22/38: o Changed ResolutionScope from COMPILE_PLUS_RUNTIME to RUNTIME only. o Improved usage docs.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 70e6281b87cb71e74fed91bb35b1abd91e68799b
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Tue Sep 5 18:04:02 2017 +0000

    o Changed ResolutionScope from COMPILE_PLUS_RUNTIME
      to RUNTIME only.
    o Improved usage docs.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807382 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/maven/plugins/jlink/JLinkMojo.java    |  3 +--
 src/site/apt/usage.apt.vm                            | 20 +++++++++++---------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 6ddbd0b..122b859 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -60,9 +60,8 @@ import org.codehaus.plexus.util.cli.Commandline;
  * 
  * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
  */
-// TODO: Check if the resolution scope is correct?
 // CHECKSTYLE_OFF: LineLength
-@Mojo( name = "jlink", requiresDependencyCollection = ResolutionScope.COMPILE_PLUS_RUNTIME, defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true )
+@Mojo( name = "jlink", requiresDependencyCollection = ResolutionScope.RUNTIME, defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true )
 // CHECKSTYLE_ON: LineLength
 public class JLinkMojo
     extends AbstractJLinkMojo
diff --git a/src/site/apt/usage.apt.vm b/src/site/apt/usage.apt.vm
index f5db5ea..a43696d 100644
--- a/src/site/apt/usage.apt.vm
+++ b/src/site/apt/usage.apt.vm
@@ -65,7 +65,8 @@ Usage
 * Usage of the Maven JLink Plugin
 
   Usually you will use the Maven JLink Plugin to create a Run Time Image from one or more modules within 
-  a multi module build. In other words it is not possible to create a Run Time Image from a single Maven
+  a multi module build.
+  In other words it is not possible to create a Run Time Image from a single Maven
   Project within the same single Maven Project.
   Let us assume you have a multi module structure which contains two modules <<mod-1>> and <<mod-2>> 
   which you like to put into the resulting Run Time Image.
@@ -133,7 +134,7 @@ Usage
 </project>
 +-----
 
-  If you like to create a Java Run Time Image of your modules the way is to create a 
+  If you like to create a Java Run Time Image of your modules you have to create a 
   separate module <<mod-jlink>> which contains the configuration to create the Run 
   Time Image which looks similar like this:
 
@@ -166,8 +167,8 @@ Usage
   Before you can do this you have to add the configuration to the parent like shown 
   in {{{Configuration_of_the_Maven_JLink_Plugin}Configuration of the Maven JLink Plugin}}.
 
-  Now you need to define which modules will be linked into the resulting Java Run Time Image which simply
-  being done by defining the modules as dependencies to your <<mod-jlink>> module like this:
+  Now you need to define which modules should be linked into the resulting Java Run Time Image which simply
+  can be done by defining the modules as dependencies to your <<mod-jlink>> module like this:
   
 +-----
 <project ...>
@@ -197,26 +198,27 @@ Usage
   
   
   After you have added the appropriate configuration you can simply create the Java Run Time Image by
-  calling from the root of your directory structure:
+  calling from the root of your multi module project like this:
   
 +----
 mvn clean package
 +----
 
-  There will be some output lines like this:
+  There are some output lines similar like this:
 
 +----
 [INFO]
 [INFO] --- maven-jlink-plugin:${project.version}:jlink (default-jlink) @ mod-jlink ---
 [INFO] Toolchain in maven-jlink-plugin: jlink [ /.../jdk1.9.0_ea+181.jdk/Contents/Home/bin/jlink ]
 [INFO] The following dependencies will be linked into the runtime image:
-[INFO]  -> com.corporate.project:mod-1:jar:1.0-SNAPSHOT
-[INFO]  -> com.corporate.project:mod-2:jar:1.0-SNAPSHOT
+[INFO]  -> module: com.soebes.nine.one.jar ( /.../mod-1/target/mod-1-1.0-SNAPSHOT.jar )
+[INFO]  -> module: com.soebes.nine.two.jar ( /.../mod-2/target/mod-2-1.0-SNAPSHOT.jar )
 [INFO] Building zip: /.../mod-jlink/target/mod-jlink-1.0-SNAPSHOT.zip
 [INFO]
 +----
 
-  If you like to install the resulting Java Run Time Image you can of course use:
+  If you like to install the resulting Java Run Time Image files into your local cache
+  you can achieve this by using:
   
 +----
 mvn clean install

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 18/38: Improved documentation of parameters

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4e16b307fb3165754a252347ac0ea61818ca21a5
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Sep 2 23:53:10 2017 +0000

    Improved documentation of parameters
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807107 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  | 28 ++++++++++------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index bf4b474..566a599 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -43,8 +43,6 @@ import org.codehaus.plexus.util.cli.Commandline;
 /**
  * The JLink goal is intended to create a Java Run Time Image file.
  * 
- * 
- * 
  * <pre>
  * Usage: jlink &lt;options&gt; --module-path &lt;modulepath&gt; --add-modules &lt;module&gt;[,&lt;module&gt;...]
  * Possible options include:
@@ -158,10 +156,8 @@ public class JLinkMojo
     private String pluginModulePath;
 
     /**
-     * The output directory for the resulting Run Time Image. The created 
-     * Run Time Image is stored in non compressed form. This will later being
-     * packaged into a <code>zip</code> file.
-     * <code>--output &lt;path&gt;</code>
+     * The output directory for the resulting Run Time Image. The created Run Time Image is stored in non compressed
+     * form. This will later being packaged into a <code>zip</code> file. <code>--output &lt;path&gt;</code>
      */
     // TODO: is this a good final location?
     @Parameter( defaultValue = "${project.build.directory}/maven-jlink", required = true, readonly = true )
@@ -201,13 +197,15 @@ public class JLinkMojo
     private boolean ignoreSigningInformation;
 
     /**
-     * <code>--no-header-files</code>
+     * This will suppress to have the <code>includes</code> directory in the resulting Java Run Time Image. The JLink
+     * command line equivalent is: <code>--no-header-files</code>
      */
     @Parameter( defaultValue = "false" )
     private boolean noHeaderFiles;
 
     /**
-     * <code>--no-man-pages</code>
+     * This will suppress to have the <code>man</code> directory in the resulting Java Run Time Image. The JLink command
+     * line equivalent is: <code>--no-man-pages</code>
      */
     @Parameter( defaultValue = "false" )
     private boolean noManPages;
@@ -272,24 +270,24 @@ public class JLinkMojo
         List<Dependency> dependencies = getSession().getCurrentProject().getDependencies();
 
         List<MavenProject> modulesToAdd = new ArrayList<>();
-//        if ( dependencies.isEmpty() )
-//        {
-//            // Do we need to do something if no dependencies have been defined ?
-//            // WARNING ?
-//        }
+        // if ( dependencies.isEmpty() )
+        // {
+        // // Do we need to do something if no dependencies have been defined ?
+        // // WARNING / ERROR or failure?
+        // }
         getLog().info( "The following dependencies will be linked into the runtime image:" );
         for ( Dependency dependency : dependencies )
         {
             // We will support "jmod" as well as "jar"
             // TODO: Think about jmod's cause they can contain config files etc. ? What todo with them? Are they already
-            // handled by jlink ? 
+            // handled by jlink ?
             if ( JAR_PACKAGING.equals( dependency.getType() ) || JMOD_PACKAGING.equals( dependency.getType() ) )
             {
                 MavenProject mp = findDependencyInProjects( dependency );
                 getLog().info( " -> " + mp.getId() );
                 // TODO: What about module name != artifactId which has been
                 // defined in module-info.java file!
-                // This would mean to read the module-info information from the jmod/jar file for example to 
+                // This would mean to read the module-info information from the jmod/jar file for example to
                 // get the appropriate information.
                 modulesToAdd.add( mp );
             }

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 26/38: o Added integation test profile o Fixed some doc issues.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c8fa867772ce60fb4aec7548a3c7fcc74a4ea669
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Thu Sep 7 18:52:44 2017 +0000

    o Added integation test profile
    o Fixed some doc issues.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807632 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 29 ++++++++++++++++++++++
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  |  9 +++++--
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index d291e12..5ffd7c1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -194,4 +194,33 @@
       </plugin>
     </plugins>
   </reporting>
+  <profiles>
+    <profile>
+      <id>run-its</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-invoker-plugin</artifactId>
+            <configuration>
+              <goals>
+                <goal>clean</goal>
+                <goal>package</goal>
+              </goals>
+            </configuration>
+            <executions>
+              <execution>
+                <id>integration-test</id>
+                <goals>
+                  <goal>install</goal>
+                  <goal>integration-test</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
 </project>
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 98c7d5a..152ccdc 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -96,7 +96,7 @@ public class JLinkMojo
 
     /**
      * Here you can define the compression of the resources being used. The command line equivalent is:
-     * <code>-c, --compress=&lt;0|1|2&gt;</code>.
+     * <code>-c, --compress=level&gt;</code>. The valid values for the level are: <code>0, 1, 2</code>.
      */
     @Parameter
     private Integer compression;
@@ -121,8 +121,13 @@ public class JLinkMojo
     private List<String> limitModules;
 
     /**
+     * <p>
+     * Usually this is not necessary, cause this is handled automatically by the given dependencies.
+     * </p>
+     * <p>
      * By using the --add-modules you can define the root modules to be resolved. The configuration in
      * <code>pom.xml</code> file can look like this:
+     * </p>
      * 
      * <pre>
      * &lt;addModules&gt;
@@ -185,7 +190,7 @@ public class JLinkMojo
     private boolean ignoreSigningInformation;
 
     /**
-     * This will suppress to have the <code>includes</code> directory in the resulting Java Run Time Image. The JLink
+     * This will suppress to have an <code>includes</code> directory in the resulting Java Run Time Image. The JLink
      * command line equivalent is: <code>--no-header-files</code>
      */
     @Parameter( defaultValue = "false" )

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 15/38: Added deploySite.sh script for later deployment of the site. Enhanced the documentation added first example usage for maven-jlink-plugin to the site.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 39161ac3c6193bd4fb97ed0c77f0df0adec2b365
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Sep 2 15:32:34 2017 +0000

    Added deploySite.sh script for later deployment of the site.
    Enhanced the documentation added first example usage for maven-jlink-plugin
    to the site.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807059 13f79535-47bb-0310-9956-ffa450edef68
---
 deploySite.sh             |  23 ++++++
 pom.xml                   |   9 ++-
 src/site/apt/usage.apt.vm | 195 ++++++++++++++++++++++++++++++++++++++++++++--
 3 files changed, 217 insertions(+), 10 deletions(-)

diff --git a/deploySite.sh b/deploySite.sh
new file mode 100755
index 0000000..f6c265d
--- /dev/null
+++ b/deploySite.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+mvn -Preporting site site:stage $@
+mvn scm-publish:publish-scm $@
diff --git a/pom.xml b/pom.xml
index 6997f82..a76de0e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,8 @@
 -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+>
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
@@ -45,10 +46,10 @@
 
   <scm>
     <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-jlink-plugin/</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-jlink-plugin/
-    </developerConnection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-jlink-plugin/</developerConnection>
     <url>http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jlink-plugin/</url>
   </scm>
+
   <issueManagement>
     <system>jira</system>
     <url>https://issues.apache.org/jira/browse/MJLINK</url>
@@ -92,7 +93,7 @@
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-archiver</artifactId>
       <version>3.5</version>
-    </dependency> 
+    </dependency>
     <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-lang3</artifactId>
diff --git a/src/site/apt/usage.apt.vm b/src/site/apt/usage.apt.vm
index da798de..6acebf0 100644
--- a/src/site/apt/usage.apt.vm
+++ b/src/site/apt/usage.apt.vm
@@ -27,13 +27,14 @@ Usage
 
 * Introduction
 
-  The Maven JLink Pluing will be used to create a Java Run-Time Image.
+  The Maven JLink plugin is used to create {{{http://openjdk.java.net/jeps/220}Modular Run-Time Images}} with
+  JDK 9.
   
-* Configuring the JLink Plugin
-
-  The configuration of the JLink Plugin is a bit different from the configuration
-  of any other plugin. The configuration should look like this:
+* Configuration of the Maven JLink Plugin
 
+  To use the Maven JLink Plugin you have to configure it as an <<<extensions>>> which means
+  the configuration in your pom file looks like this:
+  
 +-----
 <project>
   [...]
@@ -54,5 +55,187 @@ Usage
 +-----
 
   The configuration elements contains the configuration for the plugin like
-  other Maven plugins.
+  any other Maven plugins.
+
+  
+* Usage of the Maven JLink Plugin
+
+  Usually you will use the Maven JLink Plugin to create a Run Time Image from one or more modules within 
+  a multi module build. In other words it is not possible to create a Run Time Image from a single Maven
+  Project within the same single Maven Project.
+  Let us assume you have a multi module structure which contains two modules <<mod-1>> and <<mod-2>> 
+  which you like to put into the resulting Run Time Image.
+
+  The parent of the multi module looks similar like this:  
   
++-----
+<project ...>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.corporate.maven</groupId>
+    <artifactId>maven-parent</artifactId>
+    <version>2.3.1</version>
+  </parent>
+  <groupId>com.corporate.project</groupId>
+  <artifactId>parent</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+   [...]
+  <modules>
+    <module>mod-1</module>
+    <module>mod-2</module>
+  </modules>  
+   [...]
+</project>
++-----
+
+  A directory structure of such a project looks like this:
+  
++-----
+.
+├── mod-1
+│   └── src
+└── mod-2
+    └── src
++-----
+
+  The <<mod-1>> module looks similar like this:
+  
++-----
+<project ...>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.corporate.project</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>mod-1</artifactId>
+   [...]
+</project>
++-----
+
+  The <<mod-2>> module looks similar like this:
+  
++-----
+<project ...>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.corporate.project</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>mod-2</artifactId>
+   [...]
+</project>
++-----
+
+  If you like to create a Java Run Time Image of your modules the way is to create a 
+  separate module <<mod-jlink>> which contains the configuration to create the Run 
+  Time Image which looks similar like this:
+
++-----
+<project ...>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.corporate.project</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <packaging>jlink</packaging>
+  <artifactId>mod-jlink</artifactId>
+   [...]
+</project>
++-----
+
+  The directory structure now looks like this:
+  
++-----
+.
+├── mod-1
+│   └── src
+├── mod-2
+│   └── src
+└── mod-jlink
+    └── src
++-----
+
+  Before you can do this you have to add the configuration to the parent like shown 
+  in {{{Configuration_of_the_Maven_JLink_Plugin}Configuration of the Maven JLink Plugin}}.
+
+  Now you need to define which modules will be linked into the resulting Java Run Time Image which simply
+  being done by defining the modules as dependencies to your <<mod-jlink>> module like this:
+  
++-----
+<project ...>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.corporate.project</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <packaging>jlink</packaging>
+  <artifactId>mod-jlink</artifactId>
+ <dependencies>
+    <dependency>
+      <groupId>com.corporate.project</groupId>
+      <artifactId>mod-1</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.corporate.project</groupId>
+      <artifactId>mod-2</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>  
+   [...]
+</project>
++-----
+  
+  
+  After you have added the appropriate configuration you can simply create the Java Run Time Image by
+  calling from the root of your directory structure:
+  
++----
+mvn clean package
++----
+
+  There will be some output lines like this:
+
++----
+[INFO]
+[INFO] --- maven-jlink-plugin:${project.version}:jlink (default-jlink) @ mod-jlink ---
+[INFO] Toolchain in maven-jlink-plugin: jlink [ /.../jdk1.9.0_ea+181.jdk/Contents/Home/bin/jlink ]
+[INFO] The following dependencies will be linked into the runtime image:
+[INFO]  -> com.corporate.project:mod-1:jar:1.0-SNAPSHOT
+[INFO]  -> com.corporate.project:mod-2:jar:1.0-SNAPSHOT
+[INFO] Building zip: /.../mod-jlink/target/mod-jlink-1.0-SNAPSHOT.zip
+[INFO]
++----
+
+  If you like to install the resulting Java Run Time Image you can of course use:
+  
++----
+mvn clean install
++----
+  
+  or if you like to deploy the resulting artifacts to a remote repository you have to use:
+  
++----
+mvn clean deploy
++----
+  
+  At the moment the resulting Java Run Time Image is packaged into a <<zip>> archive which 
+  used to transport the whole structure which is created by <<jlink>> to a repository.
+
+  The basic structure of the resulting Java Run Time Image looks like this:
+  
++---
+jlink/
+├── bin
+├── conf
+├── include
+├── legal
+├── lib
+└── release
++---
+

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 12/38: Updated description in pom file.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0591736b189b74629ab2c3da1fb41006b6401bcc
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Thu Aug 17 19:52:35 2017 +0000

    Updated description in pom file.
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1805334 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index dc232fc..03d1bb7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,8 @@
   <packaging>maven-plugin</packaging>
 
   <name>Apache Maven JLink Plugin</name>
-  <description>JLink http://openjdk.java.net/jeps/282, http://openjdk.java.net/jeps/220</description>
+  <description>The Maven JLink Plugin is intended to create Modular Run-Time Images.
+   http://openjdk.java.net/jeps/282, http://openjdk.java.net/jeps/220</description>
   <inceptionYear>2016</inceptionYear>
 
   <prerequisites>

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 32/38: [MJLINK-4] NPE on execution Use requiresDependencyResolution instead of requiresDependencyCollection (which only downloads the poms)

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 56c529d648d77c8b83d69ee53e7a114b533e3b60
Author: Robert Scholte <rf...@apache.org>
AuthorDate: Sun Oct 15 21:17:29 2017 +0000

    [MJLINK-4] NPE on execution
    Use requiresDependencyResolution instead of requiresDependencyCollection (which only downloads the poms)
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1812236 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 28 +++++++++
 src/it/mrm/settings.xml                            | 71 ++++++++++++++++++++++
 .../projects/MJLINK-4_dependencyResolution/pom.xml | 54 ++++++++++++++++
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  |  2 +-
 4 files changed, 154 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 454f3e3..1cc90ba 100644
--- a/pom.xml
+++ b/pom.xml
@@ -198,9 +198,36 @@
       <build>
         <plugins>
           <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>mrm-maven-plugin</artifactId>
+          <version>1.1.0</version>
+          <executions>
+            <execution>
+              <goals>
+                <goal>start</goal>
+                <goal>stop</goal>
+              </goals>
+            </execution>
+          </executions>
+          <configuration>
+            <repositories>
+              <mockRepo>
+                <source>src/it/mrm/repository</source>
+              </mockRepo>
+              <proxyRepo/>
+            </repositories>
+          </configuration>
+        </plugin>
+          <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-invoker-plugin</artifactId>
             <configuration>
+              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+              <projectsDirectory>src/it/projects</projectsDirectory>
+              <settingsFile>src/it/mrm/settings.xml</settingsFile>
+              <filterProperties>
+                <mrm.repository.url>${mrm.repository.url}</mrm.repository.url>
+              </filterProperties>
               <goals>
                 <goal>clean</goal>
                 <goal>package</goal>
@@ -212,6 +239,7 @@
                 <goals>
                   <goal>install</goal>
                   <goal>integration-test</goal>
+                  <goal>verify</goal>
                 </goals>
               </execution>
             </executions>
diff --git a/src/it/mrm/settings.xml b/src/it/mrm/settings.xml
new file mode 100644
index 0000000..f639817
--- /dev/null
+++ b/src/it/mrm/settings.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
+  <mirrors>
+    <mirror>
+      <id>mrm-maven-plugin</id>
+      <name>Mock Repository Manager</name>
+      <url>@mrm.repository.url@</url>
+      <mirrorOf>*</mirrorOf>
+    </mirror>
+  </mirrors>
+  <profiles>
+    <profile>
+      <id>it-repo</id>
+      <repositories>
+        <repository>
+          <id>snapshots</id>
+          <url>@mrm.repository.url@</url>
+          <releases>
+            <enabled>true</enabled>
+            <checksumPolicy>ignore</checksumPolicy>
+            <updatePolicy>never</updatePolicy>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+            <checksumPolicy>ignore</checksumPolicy>
+            <updatePolicy>always</updatePolicy>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>snapshots</id>
+          <url>@mrm.repository.url@</url>
+          <releases>
+            <enabled>true</enabled>
+            <checksumPolicy>ignore</checksumPolicy>
+            <updatePolicy>never</updatePolicy>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+            <checksumPolicy>ignore</checksumPolicy>
+            <updatePolicy>always</updatePolicy>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+  </profiles>
+  <activeProfiles>
+    <activeProfile>it-repo</activeProfile>
+  </activeProfiles>
+</settings>
diff --git a/src/it/projects/MJLINK-4_dependencyResolution/pom.xml b/src/it/projects/MJLINK-4_dependencyResolution/pom.xml
new file mode 100644
index 0000000..4dea714
--- /dev/null
+++ b/src/it/projects/MJLINK-4_dependencyResolution/pom.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins.jlink.its</groupId>
+  <artifactId>mjlink4</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <packaging>jlink</packaging>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jlink-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+        <configuration>
+            <noHeaderFiles>true</noHeaderFiles>
+            <noManPages>true</noManPages>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <!-- use a dependency with a module-info.class -->
+      <artifactId>asm</artifactId>
+      <groupId>org.ow2.asm</groupId>
+      <version>6.0</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index b1cd330..be29b02 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -61,7 +61,7 @@ import org.codehaus.plexus.util.cli.Commandline;
  * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
  */
 // CHECKSTYLE_OFF: LineLength
-@Mojo( name = "jlink", requiresDependencyCollection = ResolutionScope.RUNTIME, defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true )
+@Mojo( name = "jlink", requiresDependencyResolution = ResolutionScope.RUNTIME, defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true )
 // CHECKSTYLE_ON: LineLength
 public class JLinkMojo
     extends AbstractJLinkMojo

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 31/38: [MJLINK-5] Parameter 'compression' is wrong. It is 'compress' o Changed the wrong parameter for commandline from compression into the correct on compress. Change the name of the parameter accordingly.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e3e89569b714f5f83c73ae460249266427539f9b
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Mon Sep 18 17:22:59 2017 +0000

    [MJLINK-5] Parameter 'compression' is wrong. It is 'compress'
     o Changed the wrong parameter for commandline from compression
       into the correct on compress. Change the name of the parameter
       accordingly.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1808750 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 0087cf2..b1cd330 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -99,7 +99,7 @@ public class JLinkMojo
      * <code>-c, --compress=level&gt;</code>. The valid values for the level are: <code>0, 1, 2</code>.
      */
     @Parameter
-    private Integer compression;
+    private Integer compress;
 
     /**
      * Limit the universe of observable modules. The following gives an example of the configuration which can be used
@@ -447,10 +447,10 @@ public class JLinkMojo
     private void failIfParametersAreNotInTheirValidValueRanges()
         throws MojoFailureException
     {
-        if ( compression != null && ( compression < 0 || compression > 2 ) )
+        if ( compress != null && ( compress < 0 || compress > 2 ) )
         {
             String message =
-                "The given compression parameters " + compression + " is not in the valid value range from 0..2";
+                "The given compress parameters " + compress + " is not in the valid value range from 0..2";
             getLog().error( message );
             throw new MojoFailureException( message );
         }
@@ -517,10 +517,10 @@ public class JLinkMojo
         {
             argsFile.println( "--ignore-signing-information" );
         }
-        if ( compression != null )
+        if ( compress != null )
         {
-            argsFile.println( "--compression" );
-            argsFile.println( compression );
+            argsFile.println( "--compress" );
+            argsFile.println( compress );
         }
 
         if ( disablePlugin != null )

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 27/38: Improved docs

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 178c289d8da5054210e402061061740a2bdccabc
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Fri Sep 8 19:45:31 2017 +0000

    Improved docs
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807811 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  |  3 ++-
 src/site/apt/index.apt.vm                          |  2 +-
 src/site/apt/usage.apt.vm                          | 16 ++++++++++--
 .../maven/plugins/jlink/AbsractJLinkMojoTest.java  | 30 ++++++++++++++++++++++
 4 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 152ccdc..0087cf2 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -233,7 +233,8 @@ public class JLinkMojo
     private ZipArchiver zipArchiver;
 
     /**
-     * Name of the generated ZIP file.
+     * Name of the generated ZIP file in the <code>target</code> directory. 
+     * This will not change the name of the installed/deployed file.
      */
     @Parameter( defaultValue = "${project.build.finalName}", readonly = true )
     private String finalName;
diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm
index 71ad63c..1f69043 100644
--- a/src/site/apt/index.apt.vm
+++ b/src/site/apt/index.apt.vm
@@ -28,7 +28,7 @@
 
 ${project.name}
 
-  The JLink Plugin is intended to create a {{{http://openjdk.java.net/jeps/220}Modular Run-Time Images}}
+  The JLink Plugin is intended to create a {{{http://openjdk.java.net/jeps/220}Modular Java Run-Time Images}}
   via {{{http://openjdk.java.net/jeps/282}jlink}}.
     
   NOTE: This is an alpha release which means everything can change until we reach the first
diff --git a/src/site/apt/usage.apt.vm b/src/site/apt/usage.apt.vm
index a43696d..ff42dc7 100644
--- a/src/site/apt/usage.apt.vm
+++ b/src/site/apt/usage.apt.vm
@@ -59,9 +59,21 @@ Usage
 </project>
 +-----
 
-  The configuration elements contains the configuration for the plugin 
+  The configuration element contains the configuration for the plugin 
   {{{https://maven.apache.org/guides/mini/guide-configuring-plugins.html}}like any other Maven plugin}}.
-  
+  The different elements which can be configured for this plugin can identified by the
+  {{{./plugin-info.html}goals documentation}}.
+
+* Requirements
+
+  Based on the foundation of the plugin it is required to have JDK 9 installed. This means
+  either you have it configured via <<JAVA_HOME>> which means to run the whole
+  Maven build with JDK 9 or via <<Toolchains>>.
+
+  Howto configure Maven related to Toolchains can be read in the
+  {{{https://maven.apache.org/guides/mini/guide-using-toolchains.html}Toolchains documentation}}.
+
+ 
 * Usage of the Maven JLink Plugin
 
   Usually you will use the Maven JLink Plugin to create a Run Time Image from one or more modules within 
diff --git a/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java b/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java
index bfdf603..630abd8 100644
--- a/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java
@@ -21,11 +21,19 @@ package org.apache.maven.plugins.jlink;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
+import java.io.ByteArrayOutputStream;
 import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
 import java.util.Arrays;
 import java.util.Collections;
 
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.Commandline;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -41,6 +49,7 @@ public class AbsractJLinkMojoTest
     public void before()
     {
         this.mojoMock = mock( AbstractJLinkMojo.class, Mockito.CALLS_REAL_METHODS );
+        when( mojoMock.getLog() ).thenReturn( mock( Log.class ) );
     }
 
     @Test
@@ -106,4 +115,25 @@ public class AbsractJLinkMojoTest
         assertThat( result ).isEqualTo( "A,B" );
     }
 
+    @Test
+    public void xxx()
+        throws MojoExecutionException, IOException, CommandLineException
+    {
+        Process p = mock( Process.class );
+
+        String b = "Error occured";
+        byte[] bytes = b.getBytes();
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        baos.write( bytes );
+        
+        when (p.getOutputStream()).thenReturn( baos );
+        
+        Commandline cmd = mock( Commandline.class );
+        when (cmd.execute()).thenReturn( p );
+        
+        File outputDirectory = mock( File.class );
+
+        mojoMock.executeCommand( cmd, outputDirectory );
+
+    }
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 05/38: o Reverted last commit to reset to release version parent's.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8e41e1b126a333986b52ec8ff2c8c79558046c61
Author: Christian Schulte <sc...@apache.org>
AuthorDate: Sun Dec 18 03:37:05 2016 +0000

    o Reverted last commit to reset to release version parent's.
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1774844 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index fe8b956..0d1b72f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@
   <parent>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-plugins</artifactId>
-    <version>31-SNAPSHOT</version>
+    <version>30</version>
     <relativePath>../maven-plugins/pom.xml</relativePath>
   </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 01/38: First starting point of maven-jlink-plugin

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ca2993484bee9feb1321eee47785dd55521f6a1e
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sun Oct 2 18:16:07 2016 +0000

    First starting point of maven-jlink-plugin
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1763091 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  89 ++++++++
 .../maven/plugins/jlink/AbstractJLinkMojo.java     | 219 +++++++++++++++++++
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  | 235 +++++++++++++++++++++
 3 files changed, 543 insertions(+)

diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..d2dc19c
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,89 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.plugins</groupId>
+    <artifactId>maven-plugins</artifactId>
+    <version>30</version>
+    <relativePath>../maven-plugins/pom.xml</relativePath>
+  </parent>
+
+  <artifactId>maven-jlink-plugin</artifactId>
+  <version>3.0.0-SNAPSHOT</version>
+  <packaging>maven-plugin</packaging>
+
+  <name>Apache Maven JLink Plugin</name>
+  <description>JLink http://openjdk.java.net/jeps/282, http://openjdk.java.net/jeps/220</description>
+  <inceptionYear>2016</inceptionYear>
+
+  <prerequisites>
+    <maven>${mavenVersion}</maven>
+  </prerequisites>
+
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-jlink-plugin/</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-jlink-plugin/
+    </developerConnection>
+    <url>http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jlink-plugin/</url>
+  </scm>
+  <issueManagement>
+    <system>jira</system>
+    <url>https://issues.apache.org/jira/browse/MJLINK</url>
+  </issueManagement>
+  <distributionManagement>
+    <site>
+      <id>apache.website</id>
+      <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/components/${maven.site.path}</url>
+    </site>
+  </distributionManagement>
+
+  <properties>
+    <mavenVersion>3.0</mavenVersion>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.plugin-tools</groupId>
+      <artifactId>maven-plugin-annotations</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <!-- Maven -->
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>${mavenVersion}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <version>${mavenVersion}</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.4</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
new file mode 100644
index 0000000..bda6813
--- /dev/null
+++ b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
@@ -0,0 +1,219 @@
+package org.apache.maven.plugins.jlink;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.apache.commons.lang.SystemUtils;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.toolchain.Toolchain;
+import org.apache.maven.toolchain.ToolchainManager;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+/**
+ * 
+ * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
+ *
+ */
+public abstract class AbstractJLinkMojo
+    extends AbstractMojo
+{
+
+    @Parameter( defaultValue = "${project}", readonly = true, required = true )
+    private MavenProject project;
+
+    @Parameter( defaultValue = "${session}", readonly = true, required = true )
+    private MavenSession session;
+
+    @Component
+    private ToolchainManager toolchainManager;
+    
+    protected String getJLinkExecutable() throws IOException
+    {
+        Toolchain tc = getToolchain();
+
+        String jLinkExecutable = null;
+        if ( tc != null )
+        {
+            jLinkExecutable = tc.findTool( "jlink" );
+        }
+
+        String jLinkCommand = "jlink" + ( SystemUtils.IS_OS_WINDOWS ? ".exe" : "" );
+
+        File jLinkExe;
+
+        if ( StringUtils.isNotEmpty( jLinkExecutable ) )
+        {
+            jLinkExe = new File( jLinkExecutable );
+
+            if ( jLinkExe.isDirectory() )
+            {
+                jLinkExe = new File( jLinkExe, jLinkCommand );
+            }
+
+            if ( SystemUtils.IS_OS_WINDOWS && jLinkExe.getName().indexOf( '.' ) < 0 )
+            {
+                jLinkExe = new File( jLinkExe.getPath() + ".exe" );
+            }
+
+            if ( !jLinkExe.isFile() )
+            {
+                throw new IOException( "The jlink executable '" + jLinkExe
+                    + "' doesn't exist or is not a file." );
+            }
+            return jLinkExe.getAbsolutePath();
+        }
+
+        // ----------------------------------------------------------------------
+        // Try to find jlink from System.getProperty( "java.home" )
+        // By default, System.getProperty( "java.home" ) = JRE_HOME and JRE_HOME
+        // should be in the JDK_HOME
+        // ----------------------------------------------------------------------
+        // For IBM's JDK 1.2 
+        // Really ?
+        if ( SystemUtils.IS_OS_AIX )
+        {
+            jLinkExe =
+                new File( SystemUtils.getJavaHome() + File.separator + ".." + File.separator + "sh", jLinkCommand );
+        }
+        // For Apple's JDK 1.6.x (and older?) on Mac OSX
+        // CHECKSTYLE_OFF: MagicNumber
+        else if ( SystemUtils.IS_OS_MAC_OSX && SystemUtils.JAVA_VERSION_FLOAT < 1.7f )
+        // CHECKSTYLE_ON: MagicNumber
+        {
+            jLinkExe = new File( SystemUtils.getJavaHome() + File.separator + "bin", jLinkCommand );
+        }
+        else
+        {
+            jLinkExe =
+                new File( SystemUtils.getJavaHome() + File.separator + ".." + File.separator + "bin", jLinkCommand );
+        }
+
+        // ----------------------------------------------------------------------
+        // Try to find javadocExe from JAVA_HOME environment variable
+        // ----------------------------------------------------------------------
+        if ( !jLinkExe.exists() || !jLinkExe.isFile() )
+        {
+            Properties env = CommandLineUtils.getSystemEnvVars();
+            String javaHome = env.getProperty( "JAVA_HOME" );
+            if ( StringUtils.isEmpty( javaHome ) )
+            {
+                throw new IOException( "The environment variable JAVA_HOME is not correctly set." );
+            }
+            if ( ( !new File( javaHome ).getCanonicalFile().exists() )
+                || ( new File( javaHome ).getCanonicalFile().isFile() ) )
+            {
+                throw new IOException( "The environment variable JAVA_HOME=" + javaHome
+                    + " doesn't exist or is not a valid directory." );
+            }
+
+            jLinkExe = new File( javaHome + File.separator + "bin", jLinkCommand );
+        }
+
+        if ( !jLinkExe.getCanonicalFile().exists() || !jLinkExe.getCanonicalFile().isFile() )
+        {
+            throw new IOException( "The jlink executable '" + jLinkExe
+                + "' doesn't exist or is not a file. Verify the JAVA_HOME environment variable." );
+        }
+
+        return jLinkExe.getAbsolutePath();
+    }
+    
+    protected void executeCommand ( Commandline cmd, File outputDirectory ) throws MojoExecutionException
+    {
+        if ( getLog().isDebugEnabled() )
+        {
+            // no quoted arguments ???
+            getLog().debug( CommandLineUtils.toString( cmd.getCommandline() ).replaceAll( "'", "" ) );
+        }
+
+        CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer();
+        CommandLineUtils.StringStreamConsumer out = new CommandLineUtils.StringStreamConsumer();
+        try
+        {
+            int exitCode = CommandLineUtils.executeCommandLine( cmd, out, err );
+
+            String output = ( StringUtils.isEmpty( out.getOutput() ) ? null : '\n' + out.getOutput().trim() );
+
+            if ( exitCode != 0 )
+            {
+                if ( StringUtils.isNotEmpty( output ) )
+                {
+                    //Reconsider to use WARN / ERROR ?
+                    getLog().info( output );
+                }
+
+                StringBuilder msg = new StringBuilder( "\nExit code: " );
+                msg.append( exitCode );
+                if ( StringUtils.isNotEmpty( err.getOutput() ) )
+                {
+                    msg.append( " - " ).append( err.getOutput() );
+                }
+                msg.append( '\n' );
+                msg.append( "Command line was: " ).append( cmd ).append( '\n' ).append( '\n' );
+
+                throw new MojoExecutionException( msg.toString() );
+            }
+
+            if ( StringUtils.isNotEmpty( output ) )
+            {
+                getLog().info( output );
+            }
+        }
+        catch ( CommandLineException e )
+        {
+            throw new MojoExecutionException( "Unable to execute jlink command: " + e.getMessage(), e );
+        }
+
+    }
+    
+    private Toolchain getToolchain()
+    {
+        Toolchain tc = null;
+        if ( toolchainManager != null )
+        {
+            tc = toolchainManager.getToolchainFromBuildContext( "jdk", session );
+        }
+
+        return tc;
+    }
+
+    public MavenProject getProject()
+    {
+        return project;
+    }
+
+    public MavenSession getSession()
+    {
+        return session;
+    }
+
+
+}
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
new file mode 100644
index 0000000..27eb088
--- /dev/null
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -0,0 +1,235 @@
+package org.apache.maven.plugins.jlink;
+
+import java.io.File;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+/**
+ * <pre>
+ * Usage: jlink &lt;options&gt; --module-path &lt;modulepath&gt; --add-modules &lt;mods&gt; --output &lt;path&gt;
+ * Possible options include:
+ *  -h, --help                        Print this help message
+ *  -p &lt;modulepath&gt;
+ *  --module-path &lt;modulepath&gt;        Module path
+ *  --limit-modules &lt;mod&gt;[,&lt;mod&gt;...]  Limit the universe of observable modules
+ *  --add-modules &lt;mod&gt;[,&lt;mod&gt;...]    Root modules to resolve
+ *  --output &lt;path&gt;                   Location of output path
+ *  --endian &lt;little|big&gt;             Byte order of generated jimage (default:native)
+ *  --version                         Version information
+ *  --save-opts &lt;filename&gt;            Save jlink options in the given file
+ *  -G, --strip-debug                 Strip debug information
+ *  -c, --compress=&lt;0|1|2&gt;            Enable compression of resources (level 2)
+ *  --plugin-module-path &lt;modulepath&gt; Custom plugin module path
+ *  --list-plugins                    List available plugins
+ *  &#64;&lt;filename&gt;                       Read options from file
+ * </pre>
+ * 
+ * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
+ */
+// TODO: Think if ResultionScope is needed here? May be we need to reconsider package phase?
+// May be it would be wise to put into PREPARE-PACKAGE and the generation of the final jimage in the package phase?
+// Furthermore It could make sense so we can change the conf files if needed...
+@Mojo( name = "jlink", requiresDependencyResolution = ResolutionScope.COMPILE, defaultPhase = LifecyclePhase.PACKAGE )
+public class JLinkMojo
+    extends AbstractJLinkMojo
+{
+    /**
+     * <code>-G, --strip-debug</code> strip debug information.
+     */
+    @Parameter( defaultValue = "false" )
+    private boolean stripDebug;
+
+    /**
+     * <code>-c, --compress=&lt;0|1|2&gt;</code> Enabled compression of resources.
+     */
+    @Parameter
+    private Integer compression;
+
+    /**
+     * Define the modulepath for the <code>JLink</code> call. <code>--module-path &lt;modulepath&gt;</code>
+     */
+    @Parameter( required = true )
+    private File modulePath;
+
+    /**
+     * Limit the univers of observable modules. <code>--limit-modules &lt;mod&gt;[,&lt;mod&gt;...]</code>
+     */
+    @Parameter
+    private List<String> limitModules;
+
+    /**
+     * Root modules to resolve. <code>--add-modules &lt;mod&gt;[,&lt;mod&gt;...]</code>
+     */
+    @Parameter
+    private List<String> addModules;
+
+    /**
+     * Custom plugin module path <code>--plugin-module-path &lt;modulepath&gt;</code>
+     */
+    @Parameter
+    private File pluginModulePath;
+
+    /**
+     * <code>--output &lt;path&gt;</code> 
+     * </p>
+     * TODO: Think about the default value? I'm not sure if something different would
+     * be better?
+     */
+    @Parameter( defaultValue = "${project.build.output}/link-result" )
+    private File outputDirectory;
+
+    /**
+     * Byte order of generated jimage (default:native). <code>--endian &lt;little|big&gt;</code>.
+     * </p>
+     * TODO: Reconsider setting the default value? Hasn't that been set already?
+     */
+    @Parameter( defaultValue = "native" )
+    private String endian;
+
+    public void execute()
+        throws MojoExecutionException, MojoFailureException
+    {
+
+        failIfParametersAreNotInTheirValidValueRanges();
+
+        String jLinkExecutable;
+        try
+        {
+            jLinkExecutable = getJLinkExecutable();
+        }
+        catch ( IOException e )
+        {
+            throw new MojoFailureException( "Unable to find jlink command: " + e.getMessage(), e );
+        }
+
+        deleteOutputDirectoryIfItAlreadyExists();
+
+        // Synopsis
+        // Usage: jlink <options> --module-path <modulepath> --add-modules <mods> --output <path>
+        Commandline cmd = createJLinkCommandLine();
+        cmd.setExecutable( jLinkExecutable );
+
+        executeCommand( cmd, outputDirectory );
+        
+    }
+
+    private void failIfParametersAreNotInTheirValidValueRanges()
+        throws MojoFailureException
+    {
+        if ( compression != null && ( compression < 0 || compression > 2 ) )
+        {
+            String message =
+                "The given compression parameters " + compression + " is not in the valid value range from 0..2";
+            getLog().error( message );
+            throw new MojoFailureException( message );
+        }
+    }
+
+    private void deleteOutputDirectoryIfItAlreadyExists()
+        throws MojoExecutionException
+    {
+        if ( outputDirectory.exists() )
+        {
+            // Delete the output folder of JLink before we start
+            // otherwise JLink will fail with a message "Error: directory already exists: ..."
+            try
+            {
+                FileUtils.forceDelete( outputDirectory );
+            }
+            catch ( IOException e )
+            {
+                getLog().error( "IOException", e );
+                throw new MojoExecutionException( "Failure during deletion of " + outputDirectory.getAbsolutePath()
+                    + " occured." );
+            }
+        }
+    }
+
+    private Commandline createJLinkCommandLine()
+    {
+        Commandline cmd = new Commandline();
+
+        if ( stripDebug )
+        {
+            cmd.createArg().setValue( "--strip-debug" );
+        }
+
+        if ( compression != null )
+        {
+            cmd.createArg().setValue( "--compression" );
+            cmd.createArg().setValue( compression.toString() );
+        }
+
+        // CHECK if this assumption here is correct?
+        if ( modulePath != null && modulePath.exists() && modulePath.isDirectory() )
+        {
+            cmd.createArg().setValue( "--module-path" );
+            cmd.createArg().setFile( modulePath );
+        }
+
+        if ( limitModules != null && !limitModules.isEmpty() )
+        {
+            cmd.createArg().setValue( "--limit-modules" );
+            StringBuilder sb = getCommaSeparatedList( limitModules );
+            cmd.createArg().setValue( sb.toString() );
+        }
+
+        if ( addModules != null && !addModules.isEmpty() )
+        {
+            cmd.createArg().setValue( "--add-modules" );
+            StringBuilder sb = getCommaSeparatedList( addModules );
+            cmd.createArg().setValue( sb.toString() );
+        }
+
+        if ( outputDirectory != null )
+        {
+            cmd.createArg().setValue( "--output" );
+            cmd.createArg().setFile( outputDirectory );
+        }
+
+        return cmd;
+    }
+
+    private StringBuilder getCommaSeparatedList( List<String> modules )
+    {
+        StringBuilder sb = new StringBuilder();
+        for ( String module : modules )
+        {
+            if ( sb.length() > 0 )
+            {
+                sb.append( ',' );
+            }
+            sb.append( module );
+        }
+        return sb;
+    }
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 10/38: Migrate to get this running on JDK 9+178 and don't fail with IndexOutOfBounceException which is caused by commons-lang 2.4.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 63ca6a5bcd55988ad1242ff4340c887d2caaffee
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Wed Jul 19 18:28:16 2017 +0000

    Migrate to get this running on JDK 9+178
    and don't fail with IndexOutOfBounceException
    which is caused by commons-lang 2.4.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1802422 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  7 +++----
 .../maven/plugins/jlink/AbstractJLinkMojo.java     | 22 ++--------------------
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  |  3 +--
 3 files changed, 6 insertions(+), 26 deletions(-)

diff --git a/pom.xml b/pom.xml
index 296a803..b609c13 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,11 +92,10 @@
       <artifactId>plexus-archiver</artifactId>
       <version>3.4</version>
     </dependency> 
-    
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-      <version>2.4</version>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+      <version>3.6</version>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
diff --git a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
index d4540c5..9efa97f 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
@@ -27,7 +27,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
-import org.apache.commons.lang.SystemUtils;
+import org.apache.commons.lang3.SystemUtils;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -107,25 +107,7 @@ public abstract class AbstractJLinkMojo
         // By default, System.getProperty( "java.home" ) = JRE_HOME and JRE_HOME
         // should be in the JDK_HOME
         // ----------------------------------------------------------------------
-        // For IBM's JDK 1.2
-        // Really ?
-        if ( SystemUtils.IS_OS_AIX )
-        {
-            jLinkExe =
-                new File( SystemUtils.getJavaHome() + File.separator + ".." + File.separator + "sh", jLinkCommand );
-        }
-        // For Apple's JDK 1.6.x (and older?) on Mac OSX
-        // CHECKSTYLE_OFF: MagicNumber
-        else if ( SystemUtils.IS_OS_MAC_OSX && SystemUtils.JAVA_VERSION_FLOAT < 1.7f )
-        // CHECKSTYLE_ON: MagicNumber
-        {
-            jLinkExe = new File( SystemUtils.getJavaHome() + File.separator + "bin", jLinkCommand );
-        }
-        else
-        {
-            jLinkExe =
-                new File( SystemUtils.getJavaHome() + File.separator + ".." + File.separator + "bin", jLinkCommand );
-        }
+        jLinkExe = new File( SystemUtils.getJavaHome() + File.separator + ".." + File.separator + "bin", jLinkCommand );
 
         // ----------------------------------------------------------------------
         // Try to find javadocExe from JAVA_HOME environment variable
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 1a3e9ed..261ba3e 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -25,7 +25,6 @@ import java.io.PrintStream;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.commons.lang.SystemUtils;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
@@ -547,7 +546,7 @@ public class JLinkMojo
         {
             if ( sb.length() > 0 )
             {
-                sb.append( SystemUtils.PATH_SEPARATOR );
+                sb.append( File.pathSeparator );
             }
             sb.append( module );
         }

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 11/38: Upgraded maven-archiver 3.2.0, plexus-archiver 3.5 Improved code.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 144571b6e21ae5370e92fff69e486c9f6e2409b9
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Thu Aug 17 19:38:52 2017 +0000

    Upgraded maven-archiver 3.2.0, plexus-archiver 3.5
    Improved code.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1805333 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  4 +--
 .../maven/plugins/jlink/AbstractJLinkMojo.java     |  1 +
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  | 36 ++++++++++++++--------
 3 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/pom.xml b/pom.xml
index b609c13..dc232fc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,12 +85,12 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-archiver</artifactId>
-      <version>3.1.1</version>
+      <version>3.2.0</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-archiver</artifactId>
-      <version>3.4</version>
+      <version>3.5</version>
     </dependency> 
     <dependency>
       <groupId>org.apache.commons</groupId>
diff --git a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
index 9efa97f..70f2860 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
@@ -77,6 +77,7 @@ public abstract class AbstractJLinkMojo
             jLinkExecutable = tc.findTool( "jlink" );
         }
 
+        //TODO: Check if there exist a more elegant way?
         String jLinkCommand = "jlink" + ( SystemUtils.IS_OS_WINDOWS ? ".exe" : "" );
 
         File jLinkExe;
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 261ba3e..62334b9 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -112,7 +112,7 @@ public class JLinkMojo
     private Integer compression;
 
     /**
-     * Limit the univers of observable modules. <code>--limit-modules &lt;mod&gt;[,&lt;mod&gt;...]</code>
+     * Limit the universe of observable modules. <code>--limit-modules &lt;mod&gt;[,&lt;mod&gt;...]</code>
      */
     @Parameter
     private List<String> limitModules;
@@ -143,7 +143,6 @@ public class JLinkMojo
     /**
      * Byte order of generated jimage (default:native). <code>--endian &lt;little|big&gt;</code>.
      * </p>
-     * TODO: Reconsider setting the default value? Hasn't that been set already?
      */
     @Parameter( defaultValue = "native" )
     private String endian;
@@ -221,22 +220,14 @@ public class JLinkMojo
         throws MojoExecutionException, MojoFailureException
     {
 
-        String jLinkExec;
-        try
-        {
-            jLinkExec = getJLinkExecutable();
-        }
-        catch ( IOException e )
-        {
-            throw new MojoFailureException( "Unable to find jlink command: " + e.getMessage(), e );
-        }
+        String jLinkExec = getExecutable();
 
         getLog().info( "Toolchain in maven-jlink-plugin: jlink [ " + jLinkExec + " ]" );
 
         // TODO: Find a more better and cleaner way?
         File jLinkExecuteable = new File( jLinkExec );
 
-        // Really Hacky...do we have a better solution?
+        // Really Hacky...do we have a better solution to find the jmods directory of the JDK?
         File jLinkParent = jLinkExecuteable.getParentFile().getParentFile();
         File jmodsFolder = new File( jLinkParent, JMODS );
 
@@ -250,16 +241,22 @@ public class JLinkMojo
         List<Dependency> dependencies = getSession().getCurrentProject().getDependencies();
 
         List<MavenProject> modulesToAdd = new ArrayList<>();
+        if ( dependencies.isEmpty() )
+        {
+            
+        }
         getLog().info( "The following dependencies will be linked into the runtime image:" );
         for ( Dependency dependency : dependencies )
         {
             // We will support "jmod" as well as "jar"
+            // TODO: Think about jmod's cause they can contain config files etc. ? What todo with them?
             if ( JAR_PACKAGING.equals( dependency.getType() ) || JMOD_PACKAGING.equals( dependency.getType() ) )
             {
                 MavenProject mp = findDependencyInProjects( dependency );
                 getLog().info( " -> " + mp.getId() );
                 // TODO: What about module name != artifactId which has been
                 // defined in module-info.java file!
+                // This would mean to read the module-info information from the jmod file for example...
                 modulesToAdd.add( mp );
             }
         }
@@ -292,6 +289,21 @@ public class JLinkMojo
         getProject().getArtifact().setFile( createZipArchiveFromImage );
     }
 
+    private String getExecutable()
+        throws MojoFailureException
+    {
+        String jLinkExec;
+        try
+        {
+            jLinkExec = getJLinkExecutable();
+        }
+        catch ( IOException e )
+        {
+            throw new MojoFailureException( "Unable to find jlink command: " + e.getMessage(), e );
+        }
+        return jLinkExec;
+    }
+
     private boolean projectHasAlreadySetAnArtifact()
     {
         if ( getProject().getArtifact().getFile() != null )

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 17/38: Changed location for resulting run time image Added more docs.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 51b26782a41ada844279cd524925ea5f6d4b3324
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Sep 2 22:03:17 2017 +0000

    Changed location for resulting run time image
    Added more docs.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807102 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java | 12 +++++++++---
 src/site/apt/usage.apt.vm                                   |  6 +++++-
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index a8b7bf3..bf4b474 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -41,6 +41,10 @@ import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
 /**
+ * The JLink goal is intended to create a Java Run Time Image file.
+ * 
+ * 
+ * 
  * <pre>
  * Usage: jlink &lt;options&gt; --module-path &lt;modulepath&gt; --add-modules &lt;module&gt;[,&lt;module&gt;...]
  * Possible options include:
@@ -82,7 +86,7 @@ import org.codehaus.plexus.util.cli.Commandline;
  * 
  * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
  */
-// TODO: Check things about conf files?
+// TODO: Check if the resolution scope is correct?
 // CHECKSTYLE_OFF: LineLength
 @Mojo( name = "jlink", requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME, defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true )
 // CHECKSTYLE_ON: LineLength
@@ -154,11 +158,13 @@ public class JLinkMojo
     private String pluginModulePath;
 
     /**
-     * The output directory for the resulting Run Time Image. This is stored in non compressed form.
+     * The output directory for the resulting Run Time Image. The created 
+     * Run Time Image is stored in non compressed form. This will later being
+     * packaged into a <code>zip</code> file.
      * <code>--output &lt;path&gt;</code>
      */
     // TODO: is this a good final location?
-    @Parameter( defaultValue = "${project.build.directory}/jlink" )
+    @Parameter( defaultValue = "${project.build.directory}/maven-jlink", required = true, readonly = true )
     private File outputDirectoryImage;
 
     @Parameter( defaultValue = "${project.build.directory}", required = true, readonly = true )
diff --git a/src/site/apt/usage.apt.vm b/src/site/apt/usage.apt.vm
index a158306..93f631a 100644
--- a/src/site/apt/usage.apt.vm
+++ b/src/site/apt/usage.apt.vm
@@ -227,7 +227,9 @@ mvn clean deploy
   At the moment the resulting Java Run Time Image is packaged into a <<zip>> archive which 
   used to transport the whole structure which is created by <<jlink>> to a repository.
 
-  The basic structure of the resulting Java Run Time Image looks like this:
+  The resulting 
+  {{{https://docs.oracle.com/javase/9/install/installed-directory-structure-jdk-and-jre.htm}Java Run Time Image directory structure}}
+  looks like this:
   
 +---
 jlink/
@@ -239,3 +241,5 @@ jlink/
 └── release
 +---
 
+  
+

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 03/38: Allow own jdkToolchain use @jlinkArgs file to support long commandlines

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f3d4965ff2757e1cb8241afa0915778e7d41d2f2
Author: Robert Scholte <rf...@apache.org>
AuthorDate: Sat Oct 29 11:16:57 2016 +0000

    Allow own jdkToolchain
    use @jlinkArgs file to support long commandlines
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1767102 13f79535-47bb-0310-9956-ffa450edef68
---
 .../maven/plugins/jlink/AbstractJLinkMojo.java     | 66 +++++++++++++++--
 .../org/apache/maven/plugins/jlink/JLinkMojo.java  | 85 ++++++++++++----------
 2 files changed, 109 insertions(+), 42 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
index 4a90d1f..9e6a99e 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/AbstractJLinkMojo.java
@@ -21,6 +21,10 @@ package org.apache.maven.plugins.jlink;
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 
 import org.apache.commons.lang.SystemUtils;
@@ -45,13 +49,23 @@ import org.codehaus.plexus.util.cli.Commandline;
 public abstract class AbstractJLinkMojo
     extends AbstractMojo
 {
+    /**
+     * <p>
+     * Specify the requirements for this jdk toolchain.
+     * This overrules the toolchain selected by the maven-toolchain-plugin.
+     * </p>
+     * <strong>note:</strong> requires at least Maven 3.3.1
+     * 
+     */
+    @Parameter
+    private Map<String, String> jdkToolchain;
 
     @Parameter( defaultValue = "${project}", readonly = true, required = true )
     private MavenProject project;
 
     @Parameter( defaultValue = "${session}", readonly = true, required = true )
     private MavenSession session;
-
+    
     @Component
     private ToolchainManager toolchainManager;
     
@@ -197,20 +211,62 @@ public abstract class AbstractJLinkMojo
     private Toolchain getToolchain()
     {
         Toolchain tc = null;
-        if ( toolchainManager != null )
+        
+        if ( jdkToolchain != null )
+        {
+            // Maven 3.3.1 has plugin execution scoped Toolchain Support
+            try
+            {
+                Method getToolchainsMethod =
+                    toolchainManager.getClass().getMethod( "getToolchains", MavenSession.class, String.class,
+                                                           Map.class );
+
+                @SuppressWarnings( "unchecked" )
+                List<Toolchain> tcs =
+                    (List<Toolchain>) getToolchainsMethod.invoke( toolchainManager, session, "jdk",
+                                                                  jdkToolchain );
+
+                if ( tcs != null && tcs.size() > 0 )
+                {
+                    tc = tcs.get( 0 );
+                }
+            }
+            catch ( NoSuchMethodException e )
+            {
+                // ignore
+            }
+            catch ( SecurityException e )
+            {
+                // ignore
+            }
+            catch ( IllegalAccessException e )
+            {
+                // ignore
+            }
+            catch ( IllegalArgumentException e )
+            {
+                // ignore
+            }
+            catch ( InvocationTargetException e )
+            {
+                // ignore
+            }
+        }
+        
+        if ( tc == null )
         {
             tc = toolchainManager.getToolchainFromBuildContext( "jdk", session );
         }
-
+        
         return tc;
     }
 
-    public MavenProject getProject()
+    protected MavenProject getProject()
     {
         return project;
     }
 
-    public MavenSession getSession()
+    protected MavenSession getSession()
     {
         return session;
     }
diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 8369cb9..27cb106 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -41,6 +41,7 @@ import java.io.File;
  */
 
 import java.io.IOException;
+import java.io.PrintStream;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -82,7 +83,7 @@ import org.codehaus.plexus.util.cli.Commandline;
 // May be it would be wise to put into PREPARE-PACKAGE and the generation of the final jimage in the package phase?
 // Furthermore It could make sense so we can change the conf files if needed...
 // CHECKSTYLE_OFF: LineLength
-@Mojo( name = "jlink", requiresDependencyResolution = ResolutionScope.COMPILE, defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true )
+@Mojo( name = "jlink", requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME, defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true )
 // CHECKSTYLE_ON: LineLength
 public class JLinkMojo
     extends AbstractJLinkMojo
@@ -100,13 +101,6 @@ public class JLinkMojo
     private Integer compression;
 
     /**
-     * Define the modulepath for the <code>JLink</code> call. <code>--module-path &lt;modulepath&gt;</code> TODO: The
-     * default should be the jmods folder of the JDK...
-     */
-    @Parameter
-    private List<String> modulePaths;
-
-    /**
      * Limit the univers of observable modules. <code>--limit-modules &lt;mod&gt;[,&lt;mod&gt;...]</code>
      */
     @Parameter
@@ -127,9 +121,8 @@ public class JLinkMojo
     /**
      * <code>--output &lt;path&gt;</code>
      * </p>
-     * TODO: Think about the default value? I'm not sure if something different would be better?
      */
-    @Parameter( defaultValue = "${project.build.directory}/link-result" )
+    @Parameter( defaultValue = "${project.build.directory}/jlink" )
     private File outputDirectory;
 
     /**
@@ -140,6 +133,9 @@ public class JLinkMojo
     @Parameter( defaultValue = "native" )
     private String endian;
 
+    @Parameter( defaultValue = "${project.compileClasspathElements}", readonly = true, required = true )
+    private List<String> modulePaths;
+
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
@@ -194,6 +190,7 @@ public class JLinkMojo
         {
             addModules = new ArrayList<>();
         }
+        
         for ( MavenProject mavenProject : modulesToAdd )
         {
             addModules.add( mavenProject.getArtifactId() );
@@ -215,7 +212,15 @@ public class JLinkMojo
 
         // Synopsis
         // Usage: jlink <options> --module-path <modulepath> --add-modules <mods> --output <path>
-        Commandline cmd = createJLinkCommandLine();
+        Commandline cmd;
+        try
+        {
+            cmd = createJLinkCommandLine();
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( e.getMessage() );
+        }
         cmd.setExecutable( jLinkExec );
 
         executeCommand( cmd, outputDirectory );
@@ -283,71 +288,77 @@ public class JLinkMojo
         }
     }
 
-    Commandline createJLinkCommandLine()
+    Commandline createJLinkCommandLine() throws IOException
     {
-        Commandline cmd = new Commandline();
-
+        File file = new File( outputDirectory.getParentFile(), "jlinkArgs" );
+        if ( !getLog().isDebugEnabled() )
+        {
+            file.deleteOnExit();
+        }
+        file.getParentFile().mkdirs();
+        file.createNewFile();
+        
+        PrintStream argsFile = new PrintStream( file );
+        
         if ( stripDebug )
         {
-            cmd.createArg().setValue( "--strip-debug" );
+            argsFile.println( "--strip-debug" );
         }
 
         if ( compression != null )
         {
-            cmd.createArg().setValue( "--compression" );
-            cmd.createArg().setValue( compression.toString() );
+            argsFile.println( "--compression" );
+            argsFile.println( compression );
         }
 
         if ( modulePaths != null )
         {
-            cmd.createArg().setValue( "--module-path" );
-            StringBuilder sb = getColonSeparateList( modulePaths );
-            cmd.createArg().setValue( sb.toString() );
+            argsFile.println( "--module-path" );
+            argsFile.append( '"' )
+                    .append( getColonSeparateList( modulePaths ).replace( "\\", "\\\\" ) )
+                    .println( '"' );
         }
 
         if ( limitModules != null && !limitModules.isEmpty() )
         {
-            cmd.createArg().setValue( "--limit-modules" );
+            argsFile.println( "--limit-modules" );
             StringBuilder sb = getCommaSeparatedList( limitModules );
-            cmd.createArg().setValue( sb.toString() );
+            argsFile.println( sb.toString() );
         }
 
         if ( addModules != null && !addModules.isEmpty() )
         {
-            cmd.createArg().setValue( "--add-modules" );
+            argsFile.println( "--add-modules" );
             StringBuilder sb = getCommaSeparatedList( addModules );
-            cmd.createArg().setValue( sb.toString() );
+            argsFile.println( sb.toString() );
         }
 
         if ( outputDirectory != null )
         {
-            cmd.createArg().setValue( "--output" );
-            cmd.createArg().setFile( outputDirectory );
+            argsFile.println( "--output" );
+            argsFile.println( outputDirectory );
         }
+        
+        argsFile.close();
+
+        Commandline cmd = new Commandline();
+        cmd.createArg().setValue( '@' + file.getAbsolutePath() );
 
         return cmd;
     }
 
-    private StringBuilder getColonSeparateList( List<String> modulePaths )
+    private String getColonSeparateList( List<String> modulePaths )
     {
         StringBuilder sb = new StringBuilder();
         for ( String module : modulePaths )
         {
             if ( sb.length() > 0 )
             {
-                // FIXME: Check this ?
-                if ( SystemUtils.IS_OS_WINDOWS )
-                {
-                    sb.append( ';' );
-                }
-                else
-                {
-                    sb.append( ':' );
-                }
+                sb.append( SystemUtils.PATH_SEPARATOR );
             }
             sb.append( module );
         }
-        return sb;
+        return sb.toString();
     }
 
     private StringBuilder getCommaSeparatedList( List<String> modules )

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 04/38: o Updated to latest parent SNAPSHOT.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 7c42480d3b787cccf0239970d30632e00ebde2ba
Author: Christian Schulte <sc...@apache.org>
AuthorDate: Sun Dec 18 00:49:25 2016 +0000

    o Updated to latest parent SNAPSHOT.
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1774838 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 0d1b72f..fe8b956 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@
   <parent>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-plugins</artifactId>
-    <version>30</version>
+    <version>31-SNAPSHOT</version>
     <relativePath>../maven-plugins/pom.xml</relativePath>
   </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-jlink-plugin] 20/38: Fixed links.

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 62a7e6858392d4f93887e628f70738950d93c4a9
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sun Sep 3 00:23:10 2017 +0000

    Fixed links.
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1807112 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
index 2a9f5a4..32ed9d0 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -41,8 +41,9 @@ import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 
 /**
- * The JLink goal is intended to create a Java Run Time Image file based on 
- * {@link http://openjdk.java.net/jeps/282}, {@link http://openjdk.java.net/jeps/220}.
+ * The JLink goal is intended to create a Java Run Time Image file based on
+ * <a href="http://openjdk.java.net/jeps/282">http://openjdk.java.net/jeps/282</a>,
+ * <a href="http://openjdk.java.net/jeps/220">http://openjdk.java.net/jeps/220</a>.
  * 
  * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
  */

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.