Maven Jar Signer Plugin
  1. Maven Jar Signer Plugin
  2. MJARSIGNER-13

signing in multi-module project fails on windows

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.3
    • Labels:
      None
    • Environment:
      Windows XP, android sdk
    • Number of attachments :
      1

      Description

      I got multi-module (6 modules) android project with .pom file and "sign" profile defined. When I execute with 'sign' profile:

      • in Maven 3.0.1 - it signs 3 modules and fails. when I resume the execution (mv <goal> -rf) it signs another 3 modules and fails again. The reason for failing is: [INFO] jarsigner: attempt to rename xxx.jar to xxx.jar.orig failed.
      • in Maven 2.2.1 - it doesn't work at all, even for first module; it returns "error code 1"

      However, I tried the same .pom - everything works perfectly in Linux (Ubuntu).

      I was afraid that it might be the issue with spaces, so I hardcoded the paths - the error I got from maven than was:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign (signing) on project MyProject: Failed executing 'cmd.exe /X /C "C:\tools\JavaTMSEDevelopementKit\jre\..\bin\jarsigner.exe -verbose -keystore "C:\tmp\debug.keystore" -storepass '*****' -keypass '*****' xxx.jar '*****'debugkey"' - exitcode 1 -> [Help 1]
      

      Attaching pom file which I am using.
      Please help?

      1. pom.xml
        3 kB
        Anna Gadomska

        Activity

        Hide
        Dennis Lundberg added a comment -

        What is the error message you get from jarsigner if you run it directly from the command line?

        cmd.exe /X /C "C:\tools\JavaTMSEDevelopementKit\jre\..\bin\jarsigner.exe -verbose -keystore "C:\tmp\debug.keystore" -storepass '*****' -keypass '*****' xxx.jar '*****'debugkey"
        
        Show
        Dennis Lundberg added a comment - What is the error message you get from jarsigner if you run it directly from the command line? cmd.exe /X /C "C:\tools\JavaTMSEDevelopementKit\jre\..\bin\jarsigner.exe -verbose -keystore "C:\tmp\debug.keystore" -storepass '*****' -keypass '*****' xxx.jar '*****'debugkey"
        Hide
        Anna Gadomska added a comment -

        Dennis, it works fine when I call it from command line, separately for every module

        Show
        Anna Gadomska added a comment - Dennis, it works fine when I call it from command line, separately for every module
        Hide
        Dennis Lundberg added a comment -

        OK, what about from the parent?

        Show
        Dennis Lundberg added a comment - OK, what about from the parent?
        Hide
        Dennis Lundberg added a comment -

        Also you can try to run mvn with the -X command line option to run in debug mode. Hopefully you'll get a helpful error message or stack trace at the end.

        Show
        Dennis Lundberg added a comment - Also you can try to run mvn with the -X command line option to run in debug mode. Hopefully you'll get a helpful error message or stack trace at the end.
        Hide
        Ton van Bart added a comment - - edited

        I have the same problem with a build developed on OSX which fails on Windows (XP - my employer hasn't upgraded yet).
        Running "mvn install -X" ends with the following messages and stack trace:

        [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign' -->
        [DEBUG]   (f) alias = mykey
        [DEBUG]   (f) arguments = []
        [DEBUG]   (f) keystore = src/main/signing/testkeys
        [DEBUG]   (f) processAttachedArtifacts = true
        [DEBUG]   (f) processMainArtifact = true
        [DEBUG]   (f) project = MavenProject: org.vanbart:testapplet:0.0.1-SNAPSHOT @ C:\workspaces_STS\rct-mavenized\test\testapplet\pom.xml
        [DEBUG]   (f) removeExistingSignatures = false
        [DEBUG]   (f) skip = false
        [DEBUG]   (f) storepass = test123
        [DEBUG]   (f) verbose = false
        [DEBUG] -- end configuration --
        [INFO] [jarsigner:sign {execution: sign}]
        [DEBUG] Processing C:\workspaces_STS\rct-mavenized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar
        [DEBUG] 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_17\jre\..\bin\jarsigner.exe" -keystore src/main/signing/testkeys -storepass '*****' C:\workspa
        ces_STS\rct-mavenized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar mykey"'
        [DEBUG] jarsigner: attempt to rename C:\workspaces_STS\rct-mavenized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar to C:\workspaces_STS\rct-mav
        enized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar.orig failed
        [INFO] ------------------------------------------------------------------------
        [ERROR] BUILD ERROR
        [INFO] ------------------------------------------------------------------------
        [INFO] Failed executing 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_17\jre\..\bin\jarsigner.exe" -keystore src/main/signing/testkeys -storepass '*
        ****' C:\workspaces_STS\rct-mavenized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar mykey"' - exitcode 1
        [INFO] ------------------------------------------------------------------------
        [DEBUG] Trace
        org.apache.maven.lifecycle.LifecycleExecutionException: Failed executing 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_17\jre\..\bin\jarsigner.exe"
        -keystore src/main/signing/testkeys -storepass '*****' C:\workspaces_STS\rct-mavenized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar mykey"' -
        exitcode 1
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
                at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
                at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
                at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
                at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
                at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
                at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
                at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
        Caused by: org.apache.maven.plugin.MojoExecutionException: Failed executing 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_17\jre\..\bin\jarsigner.ex
        e" -keystore src/main/signing/testkeys -storepass '*****' C:\workspaces_STS\rct-mavenized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar mykey"'
         - exitcode 1
                at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.processArchive(AbstractJarsignerMojo.java:495)
                at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.processArtifact(AbstractJarsignerMojo.java:372)
                at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.execute(AbstractJarsignerMojo.java:197)
                at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
                ... 17 more
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 5 seconds
        [INFO] Finished at: Fri Mar 18 16:05:56 CET 2011
        [INFO] Final Memory: 21M/38M
        [INFO] ------------------------------------------------------------------------
        C:\workspaces_STS\rct-mavenized\test\testapplet>
        

        This particular project is for test, but it is a proof-of-concept that will be merged into a production project.

        Show
        Ton van Bart added a comment - - edited I have the same problem with a build developed on OSX which fails on Windows (XP - my employer hasn't upgraded yet). Running "mvn install -X" ends with the following messages and stack trace: [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign' --> [DEBUG] (f) alias = mykey [DEBUG] (f) arguments = [] [DEBUG] (f) keystore = src/main/signing/testkeys [DEBUG] (f) processAttachedArtifacts = true [DEBUG] (f) processMainArtifact = true [DEBUG] (f) project = MavenProject: org.vanbart:testapplet:0.0.1-SNAPSHOT @ C:\workspaces_STS\rct-mavenized\test\testapplet\pom.xml [DEBUG] (f) removeExistingSignatures = false [DEBUG] (f) skip = false [DEBUG] (f) storepass = test123 [DEBUG] (f) verbose = false [DEBUG] -- end configuration -- [INFO] [jarsigner:sign {execution: sign}] [DEBUG] Processing C:\workspaces_STS\rct-mavenized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar [DEBUG] 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_17\jre\..\bin\jarsigner.exe" -keystore src/main/signing/testkeys -storepass '*****' C:\workspa ces_STS\rct-mavenized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar mykey"' [DEBUG] jarsigner: attempt to rename C:\workspaces_STS\rct-mavenized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar to C:\workspaces_STS\rct-mav enized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar.orig failed [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Failed executing 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_17\jre\..\bin\jarsigner.exe" -keystore src/main/signing/testkeys -storepass '* ****' C:\workspaces_STS\rct-mavenized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar mykey"' - exitcode 1 [INFO] ------------------------------------------------------------------------ [DEBUG] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Failed executing 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_17\jre\..\bin\jarsigner.exe" -keystore src/main/signing/testkeys -storepass '*****' C:\workspaces_STS\rct-mavenized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar mykey"' - exitcode 1 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.MojoExecutionException: Failed executing 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_17\jre\..\bin\jarsigner.ex e " -keystore src/main/signing/testkeys -storepass '*****' C:\workspaces_STS\rct-mavenized\test\testapplet\target\testapplet-0.0.1-SNAPSHOT.jar mykey" ' - exitcode 1 at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.processArchive(AbstractJarsignerMojo.java:495) at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.processArtifact(AbstractJarsignerMojo.java:372) at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.execute(AbstractJarsignerMojo.java:197) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) ... 17 more [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5 seconds [INFO] Finished at: Fri Mar 18 16:05:56 CET 2011 [INFO] Final Memory: 21M/38M [INFO] ------------------------------------------------------------------------ C:\workspaces_STS\rct-mavenized\test\testapplet> This particular project is for test, but it is a proof-of-concept that will be merged into a production project.
        Hide
        Juan Pablo added a comment -

        Hello all,

        I've this problem too and it seems to be (in my case), a problem when defining plugin configuration from parent's. POM.
        I have a 3 level multimodule project with many modules inside and i choosed to configure jarsigner in topmost one (just to avoid duplicate configurations), and when using relative paths (or even $

        {basedir}

        ), it always tries to load the keystore from withing "current" module path:

        "H:\opt\java\jdk1.6.0_24_x86\jre\..\bin\jarsigner.exe -keystore H:\projects\иии\java\trunk\client\launcher\workspace\keystore\signing-jar.keystore -storepass '****' -keypass '***' H:\projects\java\trunk\client\launcher\target\client-launcher-04.08.0000.jar '****'"'
        : java.lang.RuntimeException: keystore load: H:\projects\java\trunk\client\launcher\workspace\keystore\signing-jar.keystore (The system cannot find the path specified)

        (seen when running maven with -X option (thanks, btw )

        Hope this helps

        jp

        Show
        Juan Pablo added a comment - Hello all, I've this problem too and it seems to be (in my case), a problem when defining plugin configuration from parent's. POM. I have a 3 level multimodule project with many modules inside and i choosed to configure jarsigner in topmost one (just to avoid duplicate configurations), and when using relative paths (or even $ {basedir} ), it always tries to load the keystore from withing "current" module path: "H:\opt\java\jdk1.6.0_24_x86\jre\..\bin\jarsigner.exe -keystore H:\projects\иии\java\trunk\client\launcher\workspace\keystore\signing-jar.keystore -storepass '**** ' -keypass ' *** ' H:\projects\java\trunk\client\launcher\target\client-launcher-04.08.0000.jar ' ****'"' : java.lang.RuntimeException: keystore load: H:\projects\java\trunk\client\launcher\workspace\keystore\signing-jar.keystore (The system cannot find the path specified) (seen when running maven with -X option (thanks, btw ) Hope this helps jp
        Hide
        Paul Vonnahme added a comment -

        This appears to still be an issue. I tested it on Windows 2003 and maven 3.0.4 (the latest at this time). I found this info: http://stackoverflow.com/questions/7421710/android-maven-jarsigner-jarsigner-attempt-to-rename-x-but-failed

        Which links to this blog with a workaround (workaround is to use maven-jar-plugin): http://www.jameselsey.co.uk/blogs/techblog/automating-android-application-signing-and-zipaligning-with-maven/

        If I try to sign & verify via two different executions within the jarsigner plugin configuration, I get the error. However, if I sign with an execution step in the maven-jar-plugin and then verify with an execution step in the maven-jarsigner-plugin, it works.

        Show
        Paul Vonnahme added a comment - This appears to still be an issue. I tested it on Windows 2003 and maven 3.0.4 (the latest at this time). I found this info: http://stackoverflow.com/questions/7421710/android-maven-jarsigner-jarsigner-attempt-to-rename-x-but-failed Which links to this blog with a workaround (workaround is to use maven-jar-plugin): http://www.jameselsey.co.uk/blogs/techblog/automating-android-application-signing-and-zipaligning-with-maven/ If I try to sign & verify via two different executions within the jarsigner plugin configuration, I get the error. However, if I sign with an execution step in the maven-jar-plugin and then verify with an execution step in the maven-jarsigner-plugin, it works.
        Hide
        Kurt T Stam added a comment -

        This issue pretty much kills this plugin on windows.

        [INFO] Processing C:\test\juddi\juddi-gui-dsig\target\juddi-gui-dsig-3.2.0-SNAPS
        HOT.jar
        [DEBUG] 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_43\jre\..\bin\jarsigner.
        exe" -verbose -keystore signing.keystore -storepass '****' -keypass '****' C:\
        test\juddi\juddi-gui-dsig\target\juddi-gui-dsig-3.2.0-SNAPSHOT.jar '*****'"'
        [INFO] updating: META-INF/MANIFEST.MF
        [INFO] adding: META-INF/APPLET.SF
        [INFO] adding: META-INF/APPLET.DSA
        [INFO] adding: org/
        [INFO] adding: org/apache/
        [INFO] adding: org/apache/juddi/
        [INFO] adding: org/apache/juddi/gui/
        [INFO] adding: org/apache/juddi/gui/dsig/
        [INFO] signing: org/apache/juddi/gui/dsig/XmlSignatureApplet$1.class
        [INFO] signing: org/apache/juddi/gui/dsig/XmlSignatureApplet$2.class
        [INFO] signing: org/apache/juddi/gui/dsig/XmlSignatureApplet.class
        [INFO] jarsigner: attempt to rename C:\test\juddi\juddi-gui-dsig\target\juddi-gu
        i-dsig-3.2.0-SNAPSHOT.jar to C:\test\juddi\juddi-gui-dsig\target\juddi-gui-dsig-
        3.2.0-SNAPSHOT.jar.orig failed
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD FAILURE
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 9.891s
        [INFO] Finished at: Wed May 22 16:01:54 PDT 2013
        [INFO] Final Memory: 15M/37M
        [INFO] ------------------------------------------------------------------------
        [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jarsigner-plugin:1
        .2:sign (default) on project juddi-gui-dsig: Failed executing 'cmd.exe /X /C ""C
        :\Program Files\Java\jdk1.6.0_43\jre\..\bin\jarsigner.exe" -verbose -keystore si
        gning.keystore -storepass '****' -keypass '****' C:\test\juddi\juddi-gui-dsig\
        target\juddi-gui-dsig-3.2.0-SNAPSHOT.jar '*****'"' - exitcode 1 -> [Help 1]
        org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
        rg.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign (default) on project jud
        di-gui-dsig: Failed executing 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_43
        \jre\..\bin\jarsigner.exe" -verbose -keystore signing.keystore -storepass '*****
        ' -keypass '*****' C:\test\juddi\juddi-gui-dsig\target\juddi-gui-dsig-3.2.0-SNAP
        SHOT.jar '*****'"' - exitcode 1
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
        .java:217)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
        .java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
        .java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
        ct(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
        ct(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
        ild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
        eStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
        java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
        sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
        cher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
        a:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
        uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
        352)
        Caused by: org.apache.maven.plugin.MojoExecutionException: Failed executing 'cmd
        .exe /X /C ""C:\Program Files\Java\jdk1.6.0_43\jre\..\bin\jarsigner.exe" -verbos
        e -keystore signing.keystore -storepass '****' -keypass '****' C:\test\juddi\j
        uddi-gui-dsig\target\juddi-gui-dsig-3.2.0-SNAPSHOT.jar '*****'"' - exitcode 1
        at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.processArchi
        ve(AbstractJarsignerMojo.java:495)
        at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.processArtif
        act(AbstractJarsignerMojo.java:372)
        at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.execute(Abst
        ractJarsignerMojo.java:197)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
        BuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
        .java:209)
        ... 19 more
        [ERROR]
        [ERROR]
        [ERROR] For more information about the errors and possible solutions, please rea
        d the following articles:
        [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
        xception
        C:\test\juddi\juddi-gui-dsig>

        while running the command straight up works fine:

        C:\test\juddi\juddi-gui-dsig>cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_43\j
        re\..\bin\jarsigner.exe" -verbose -keystore signing.keystore -storepass applet -
        keypass applet C:\test\juddi\juddi-gui-dsig\target\juddi-gui-dsig-3.2.0-SNAPSHOT
        .jar applet"
        updating: META-INF/MANIFEST.MF
        adding: META-INF/APPLET.SF
        adding: META-INF/APPLET.DSA
        adding: org/
        adding: org/apache/
        adding: org/apache/juddi/
        adding: org/apache/juddi/gui/
        adding: org/apache/juddi/gui/dsig/
        signing: org/apache/juddi/gui/dsig/XmlSignatureApplet$1.class
        signing: org/apache/juddi/gui/dsig/XmlSignatureApplet$2.class
        signing: org/apache/juddi/gui/dsig/XmlSignatureApplet.class

        Warning:
        The signer certificate will expire within six months.

        It is not very clear to me why it would fail, but I guess the first error is the rename to .orig which fails, so this may suggest a windows file lock?

        Our module lives here: http://svn.apache.org/repos/asf/juddi/trunk/juddi-gui-dsig/

        Please let us know if there is anything else we can do to help fixing this.

        --Kurt

        Show
        Kurt T Stam added a comment - This issue pretty much kills this plugin on windows. [INFO] Processing C:\test\juddi\juddi-gui-dsig\target\juddi-gui-dsig-3.2.0-SNAPS HOT.jar [DEBUG] 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_43\jre\..\bin\jarsigner. exe" -verbose -keystore signing.keystore -storepass '**** ' -keypass ' ****' C:\ test\juddi\juddi-gui-dsig\target\juddi-gui-dsig-3.2.0-SNAPSHOT.jar '*****'"' [INFO] updating: META-INF/MANIFEST.MF [INFO] adding: META-INF/APPLET.SF [INFO] adding: META-INF/APPLET.DSA [INFO] adding: org/ [INFO] adding: org/apache/ [INFO] adding: org/apache/juddi/ [INFO] adding: org/apache/juddi/gui/ [INFO] adding: org/apache/juddi/gui/dsig/ [INFO] signing: org/apache/juddi/gui/dsig/XmlSignatureApplet$1.class [INFO] signing: org/apache/juddi/gui/dsig/XmlSignatureApplet$2.class [INFO] signing: org/apache/juddi/gui/dsig/XmlSignatureApplet.class [INFO] jarsigner: attempt to rename C:\test\juddi\juddi-gui-dsig\target\juddi-gu i-dsig-3.2.0-SNAPSHOT.jar to C:\test\juddi\juddi-gui-dsig\target\juddi-gui-dsig- 3.2.0-SNAPSHOT.jar.orig failed [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 9.891s [INFO] Finished at: Wed May 22 16:01:54 PDT 2013 [INFO] Final Memory: 15M/37M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jarsigner-plugin:1 .2:sign (default) on project juddi-gui-dsig: Failed executing 'cmd.exe /X /C ""C :\Program Files\Java\jdk1.6.0_43\jre\..\bin\jarsigner.exe" -verbose -keystore si gning.keystore -storepass '**** ' -keypass ' ****' C:\test\juddi\juddi-gui-dsig\ target\juddi-gui-dsig-3.2.0-SNAPSHOT.jar '*****'"' - exitcode 1 -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o rg.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign (default) on project jud di-gui-dsig: Failed executing 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_43 \jre\..\bin\jarsigner.exe" -verbose -keystore signing.keystore -storepass '***** ' -keypass '*****' C:\test\juddi\juddi-gui-dsig\target\juddi-gui-dsig-3.2.0-SNAP SHOT.jar '*****'"' - exitcode 1 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor .java:217) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor .java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor .java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje ct(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje ct(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu ild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl eStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun cher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav a:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La uncher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java: 352) Caused by: org.apache.maven.plugin.MojoExecutionException: Failed executing 'cmd .exe /X /C ""C:\Program Files\Java\jdk1.6.0_43\jre\..\bin\jarsigner.exe" -verbos e -keystore signing.keystore -storepass '**** ' -keypass ' ****' C:\test\juddi\j uddi-gui-dsig\target\juddi-gui-dsig-3.2.0-SNAPSHOT.jar '*****'"' - exitcode 1 at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.processArchi ve(AbstractJarsignerMojo.java:495) at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.processArtif act(AbstractJarsignerMojo.java:372) at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.execute(Abst ractJarsignerMojo.java:197) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default BuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor .java:209) ... 19 more [ERROR] [ERROR] [ERROR] For more information about the errors and possible solutions, please rea d the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE xception C:\test\juddi\juddi-gui-dsig> while running the command straight up works fine: C:\test\juddi\juddi-gui-dsig>cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_43\j re\..\bin\jarsigner.exe" -verbose -keystore signing.keystore -storepass applet - keypass applet C:\test\juddi\juddi-gui-dsig\target\juddi-gui-dsig-3.2.0-SNAPSHOT .jar applet" updating: META-INF/MANIFEST.MF adding: META-INF/APPLET.SF adding: META-INF/APPLET.DSA adding: org/ adding: org/apache/ adding: org/apache/juddi/ adding: org/apache/juddi/gui/ adding: org/apache/juddi/gui/dsig/ signing: org/apache/juddi/gui/dsig/XmlSignatureApplet$1.class signing: org/apache/juddi/gui/dsig/XmlSignatureApplet$2.class signing: org/apache/juddi/gui/dsig/XmlSignatureApplet.class Warning: The signer certificate will expire within six months. It is not very clear to me why it would fail, but I guess the first error is the rename to .orig which fails, so this may suggest a windows file lock? Our module lives here: http://svn.apache.org/repos/asf/juddi/trunk/juddi-gui-dsig/ Please let us know if there is anything else we can do to help fixing this. --Kurt
        Hide
        Alex O added a comment -

        +1

        Show
        Alex O added a comment - +1
        Hide
        Kurt T Stam added a comment -

        Hi guys, is this project dead? Just wondering if we should spend time helping to fix this or spend time working on a using ant instead.

        Show
        Kurt T Stam added a comment - Hi guys, is this project dead? Just wondering if we should spend time helping to fix this or spend time working on a using ant instead.
        Hide
        Chris Feldhacker added a comment -

        Possibly related tidbit to consider:
        We have Windows scripts to install various IDEs and local servers, which involves using keytool.exe to import needed certificates into keystores. When we ran the imports back-to-back, it would fail with files in use (sometime it would just hang).

        What we found was we had to impose a 3-5 second delay between commands before they would work. Don't know if its a Windows issue or perhaps an issue with some of the JDK tools, but perhaps something similar is happening here...

        Would be nice to at least have the option to NOT rename the file to .orig before signing...

        Show
        Chris Feldhacker added a comment - Possibly related tidbit to consider: We have Windows scripts to install various IDEs and local servers, which involves using keytool.exe to import needed certificates into keystores. When we ran the imports back-to-back, it would fail with files in use (sometime it would just hang). What we found was we had to impose a 3-5 second delay between commands before they would work. Don't know if its a Windows issue or perhaps an issue with some of the JDK tools, but perhaps something similar is happening here... Would be nice to at least have the option to NOT rename the file to .orig before signing...
        Hide
        Dennis Lundberg added a comment -

        Hi Kurt,

        Thanks for bringing a live project to the table. It is so much easier to debug when you have something real to work with.

        We have several projects at my day job that uses this plugin, and they all work fine on Windows. I tried to see what differed between your project and ours. I took a while but finally I stumbled upon this comment in our POMs:

                <!-- This needs to run after the Jarsigner plugin execution -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                ...
        

        The problem seems to be that both jarsigner and assembly plugins are bound to the package phase. At least in our case the assembly should contain the signed artifact. So I think Chris is right in assuming that there is some file locking problem that is specific to the Windows platform.

        Anyway the solution to this problem, and I have verified it on jUDDI, is to move the assembly execution so that it comes after the jarsigner execution in the POM. If this solves this issue for you I'll add an FAQ entry for it in the plugin documentation.

        Show
        Dennis Lundberg added a comment - Hi Kurt, Thanks for bringing a live project to the table. It is so much easier to debug when you have something real to work with. We have several projects at my day job that uses this plugin, and they all work fine on Windows. I tried to see what differed between your project and ours. I took a while but finally I stumbled upon this comment in our POMs: <!-- This needs to run after the Jarsigner plugin execution --> <groupId> org.apache.maven.plugins </groupId> <artifactId> maven-assembly-plugin </artifactId> ... The problem seems to be that both jarsigner and assembly plugins are bound to the package phase. At least in our case the assembly should contain the signed artifact. So I think Chris is right in assuming that there is some file locking problem that is specific to the Windows platform. Anyway the solution to this problem, and I have verified it on jUDDI, is to move the assembly execution so that it comes after the jarsigner execution in the POM. If this solves this issue for you I'll add an FAQ entry for it in the plugin documentation.
        Hide
        Kurt T Stam added a comment -

        Super Dennis, this fixed it for us! Cheers --Kurt

        Show
        Kurt T Stam added a comment - Super Dennis, this fixed it for us! Cheers --Kurt
        Hide
        Tony Chemit added a comment -

        Hi @Dennis, Have you add your entry in the project FAQ? I don't see it, could you done it to close this issue efore next release (I hope to do it soon after releasing maven-shared-utils, maven-jarsinger,...).

        Thanks.

        Show
        Tony Chemit added a comment - Hi @Dennis, Have you add your entry in the project FAQ? I don't see it, could you done it to close this issue efore next release (I hope to do it soon after releasing maven-shared-utils, maven-jarsinger,...). Thanks.
        Hide
        Tony Chemit added a comment -

        Entry added in FAQ at rev1553915

        Show
        Tony Chemit added a comment - Entry added in FAQ at rev1553915
        Show
        Jason Pyeron added a comment - Link to FAQ: http://maven.apache.org/plugins/maven-jarsigner-plugin/faq.html
        Hide
        Jason Pyeron added a comment -

        E.g.

        <build>
        	<plugins>
        		<plugin>
        			<groupId>org.apache.maven.plugins</groupId>
        			<artifactId>maven-jarsigner-plugin</artifactId>
        		</plugin>
        		<plugin>
        			<groupId>org.apache.maven.plugins</groupId>
        			<artifactId>maven-assembly-plugin</artifactId>
        		</plugin>
        	</plugins>
        </build>
        
        Show
        Jason Pyeron added a comment - E.g. <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jarsigner-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> </plugin> </plugins> </build>

          People

          • Assignee:
            Tony Chemit
            Reporter:
            Anna Gadomska
          • Votes:
            6 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: