diff --git a/src/main/java/com/akathist/maven/plugins/launch4j/Launch4jMojo.java b/src/main/java/com/akathist/maven/plugins/launch4j/Launch4jMojo.java index 5bc3e0e..4f408a9 100644 --- a/src/main/java/com/akathist/maven/plugins/launch4j/Launch4jMojo.java +++ b/src/main/java/com/akathist/maven/plugins/launch4j/Launch4jMojo.java @@ -137,7 +137,7 @@ public class Launch4jMojo extends AbstractMojo { * in order to avoid opening a DOS window. * Choosing gui also enables other options like taskbar icon and a splash screen. */ - @Parameter + @Parameter(defaultValue = "console", required = true) private String headerType; /** @@ -350,6 +350,8 @@ private void doExecute() throws MojoExecutionException { getLog().debug("Skipping execution of the plugin"); return; } + + fillSensibleJreDefaults(); if (!disableVersionInfoDefaults) { try { @@ -491,6 +493,18 @@ private void doExecute() throws MojoExecutionException { } } } + + private void fillSensibleJreDefaults() throws MojoExecutionException { + if (jre == null) { + jre = new Jre(); + } + + if (jre.path == null) { + String pathDef = "%JAVA_HOME%;%PATH%"; + getLog().warn("jre.path not set, defaulting to \"" + pathDef + "\""); + jre.path = pathDef; + } + } /** * Prepares a little directory for launch4j to do its thing. Launch4j needs a bunch of object files