Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maven build fails at install-license when install4j.home is not set #19

Closed
AndreasSchaek opened this issue Feb 14, 2014 · 7 comments
Closed
Milestone

Comments

@AndreasSchaek
Copy link

The documentation says, that the goal insatll-license will be skipped, if install4j.home is not set or invalid.
But when install4j.home is not set i get this error message and the build fails:

[ERROR] Failed to execute goal org.sonatype.install4j:install4j-maven-plugin:1.0.6:install-license (install-license) on project h-installer: The parameters 'installDir' for goal org.sonatype.install4j:install4j-maven-plugin:1.0.6:install-license are missing or invalid -> [Help 1]

When I set the variable to an invalid location, the goal is skipped.
Since I dont want all clients to set a variable to an invalid location, I need the goal to be skipped, when the variable is not set.

@jdillon
Copy link
Contributor

jdillon commented Feb 14, 2014

Sorry about that, you are right the docs and code are not in sync here.

I suggest you simply define a dummy property in your pom.xml for now. This is how we are presently using the plugin with this in the pom.xml of the project building the installers, and we override this in settings.xml to configure real details:

  <properties>
    <install4j.home>NOT_CONFIGURED</install4j.home>
    <install4j.winKeystorePassword>NOT_CONFIGURED</install4j.winKeystorePassword>
    <install4j.macKeystorePassword>NOT_CONFIGURED</install4j.macKeystorePassword>
    <install4j-support.version>1.0.6</install4j-support.version>
  </properties>

And I’ll try and find time to update the plugin so this is not needed, but no idea when I’ll find time ATM ;-)

@AndreasSchaek
Copy link
Author

I'm about to look into the source and bugfix it. Do you want me to post a patch when I'm done?

@AndreasSchaek
Copy link
Author

Well this one is pretty easy. Here's the patch since im unable to send it to the repository

install4j-maven-plugin/src/main/java/org/sonatype/install4j/maven/Install4jcMojoSupport.java 
index 4277708..3396b56 100644
@@ -41,7 +41,7 @@ public abstract class Install4jcMojoSupport
     /**
      * The location of the install4j installation.
      */
-    @Parameter(property = "install4j.home", required = true)
+    @Parameter(property = "install4j.home", required = false)
     protected File installDir;

     /**
@@ -62,7 +62,11 @@ public abstract class Install4jcMojoSupport

         AntHelper ant = new AntHelper(this, project);

-        if (!installDir.exists()) {
+        if (installDir == null) {
+            maybeFailIfMissing("install directory not set. Skipping build step");
+            return;
+        }
+        else if (!installDir.exists()) {
             maybeFailIfMissing("Invalid install directory: " + installDir);
             return;
         }

@jdillon
Copy link
Contributor

jdillon commented Mar 3, 2014

fixed: 30ba2c0

thx

@jdillon jdillon added this to the 1.0.7 milestone Mar 3, 2014
@jdillon
Copy link
Contributor

jdillon commented Mar 6, 2014

please verify and I'll start a release

@AndreasSchaek
Copy link
Author

tested and working.

@jdillon
Copy link
Contributor

jdillon commented Mar 7, 2014

1.0.7 released, updating site now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants