Skip to content

Commit

Permalink
U fix #27: Using the JavaPackager maven plugin, on a project without …
Browse files Browse the repository at this point in the history
…dependencies fails
  • Loading branch information
fvarrui committed Apr 15, 2020
1 parent f55597a commit bc6daae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/io/github/fvarrui/javapackager/PackageMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,11 @@ private String getRequiredModules(File libsFolder) throws MojoExecutionException

File jdeps = new File(System.getProperty("java.home"), "/bin/jdeps");

File jarLibs = new File(libsFolder, "*.jar");
File jarLibs = null;
if (libsFolder.exists())
jarLibs = new File(libsFolder, "*.jar");
else
getLog().warn("No dependencies found!");

List<String> modulesList;

Expand Down Expand Up @@ -983,7 +987,7 @@ private String getRequiredModules(File libsFolder) throws MojoExecutionException
modulesList.addAll(additionalModules);

if (modulesList.isEmpty()) {
getLog().warn("It was not possible to determine the necessary modules. all modules will be included");
getLog().warn("It was not possible to determine the necessary modules. All modules will be included");
modulesList.add("ALL-MODULE-PATH");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class CommandUtils {

private static void createArguments(Commandline command, Object ... arguments) {
for (Object argument : arguments) {
if (argument == null) continue;
if (argument instanceof File)
command.createArg().setFile((File)argument);
else if (argument.getClass().isArray())
Expand Down

0 comments on commit bc6daae

Please sign in to comment.