Skip to content
Browse files

Make installDir optional so we can skip if this is not configured

  • Loading branch information...
1 parent aa36435 commit 30ba2c0c3e665596ed26eddc55c1c0e63e87b868 @jdillon jdillon committed Mar 3, 2014
View
10 install4j-maven-plugin/src/main/java/org/sonatype/install4j/maven/Install4jcMojoSupport.java
@@ -13,15 +13,15 @@
package org.sonatype.install4j.maven;
+import java.io.File;
+
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.tools.ant.taskdefs.ExecTask;
import org.codehaus.plexus.util.Os;
-import java.io.File;
-
/**
* Support for install4jc-based tasks.
*
@@ -41,7 +41,7 @@
/**
* The location of the install4j installation.
*/
- @Parameter(property = "install4j.home", required = true)
+ @Parameter(property = "install4j.home")
protected File installDir;
/**
@@ -62,6 +62,10 @@ protected void doExecute() throws Exception {
AntHelper ant = new AntHelper(this, project);
+ if (installDir == null) {
+ maybeFailIfMissing("Install directory not configured");
+ return;
+ }
if (!installDir.exists()) {
maybeFailIfMissing("Invalid install directory: " + installDir);
return;

0 comments on commit 30ba2c0

Please sign in to comment.
Something went wrong with that request. Please try again.