You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2018/09/10 18:29:43 UTC

[maven-jlink-plugin] branch MJLINK-26 updated: fixup! ** WIP - [MJLINK-26] - Can not create an image from a single module project without a dependency

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

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


The following commit(s) were added to refs/heads/MJLINK-26 by this push:
     new 2f1772e  fixup! ** WIP - [MJLINK-26] - Can not create an image from a single module project without a dependency
2f1772e is described below

commit 2f1772e503f54c467dc340129661879ce45b9d87
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Mon Sep 10 20:29:38 2018 +0200

    fixup! ** WIP - [MJLINK-26] - Can not create an image from a single module project without a dependency
---
 .../org/apache/maven/plugins/jlink/JLinkMojo.java    | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 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 7cdeaec..6af097b 100644
--- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
+++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
@@ -269,24 +269,16 @@ public class JLinkMojo
 
         ifOutputDirectoryExistsDelteIt();
 
-        Collection<String> modulesToAdd;
-        if ( addModules == null )
+        Collection<String> modulesToAdd = new ArrayList<>();
+        if ( addModules != null )
         {
-            modulesToAdd = new ArrayList<>();
-        }
-        else
-        {
-            modulesToAdd = new ArrayList<>( addModules );
+            modulesToAdd.addAll( addModules );
         }
 
-        Collection<String> pathsOfModules;
-        if ( modulePaths == null )
-        {
-            pathsOfModules = new ArrayList<>();
-        }
-        else
+        Collection<String> pathsOfModules = new ArrayList<>();
+        if ( modulePaths != null )
         {
-            pathsOfModules = new ArrayList<>( modulePaths );
+            pathsOfModules.addAll( modulePaths );
         }
 
         for ( Entry<String, File> item : getModulePathElements().entrySet() )