Note that there are some explanatory texts on larger screens.

plurals
  1. POmaven-jarsigner-plugin fails during Jenkins build but not on command line
    primarykey
    data
    text
    <p>Following environment given:</p> <ul> <li>Windows Server 2012</li> <li>Java 1.6</li> <li>Maven project with configured (assembly or shade plugin) AND jarsigner:sign/verify plugin</li> <li>Jenkins 1.518 running within Tomcat 7 (which runs with Java 1.7)</li> <li>Tomcat running as Windows Service User</li> </ul> <p>When building the maven project everything works fine and the assembly is built (with the assembly plugin as well as with the shade plugin) and finally the assembly is signed and verified with the maven-jarsigner-plugin.</p> <p><strong>BUT</strong> the same project configured in Jenkins fails during build when jarsigner is trying to sign the assembly. Log File says:</p> <pre><code>message : Failed to execute goal org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign (sign) on project ext.pdfgui: Execution of 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_43\jre\..\bin\jarsigner.exe" -verbose -keystore src/main/resources/signjar.keystore -storepass '*****' -keypass '*****' "D:\server\jenkinsWorkingDir\jobs\&lt;project name&gt;\workspace\trunk\&lt;module&gt;\target\artifact-jar-with-dependencies.jar" &lt;cert alias&gt;"' failed - Errorcode (1) cause : Execution of 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_43\jre\..\bin\jarsigner.exe" -verbose -keystore src/main/resources/signjar.keystore -storepass '*****' -keypass '*****' "D:\server\jenkinsWorkingDir\jobs\&lt;project name&gt;\workspace\trunk\&lt;module&gt;\target\artifact-jar-with-dependencies.jar" &lt;cert alias&gt;"' failed - Errorcode (1) Stack trace : org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign (sign) on project ext.pdfgui: Execution of 'cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_43\jre\..\bin\jarsigner.exe" -verbose -keystore src/main/resources/signjar.keystore -storepass '*****' -keypass '*****' "D:\server\jenkinsWorkingDir\jobs\&lt;project name&gt;\workspace\trunk\&lt;module&gt;\target\artifact-jar-with-dependencies.jar" &lt;cert alias&gt;"' failed - Errorcode (1) </code></pre> <p>I translated log file above from German to English so it might differ because I dont know exactly the right wording.</p> <p>Verbose log file says:</p> <pre><code>[INFO] jarsigner: attempt to rename D:\server\jenkinsWorkingDir\jobs\&lt;project name&gt;\workspace\trunk\&lt;module&gt;\target\&lt;artifact&gt;-jar-with-dependencies.jar to D:\server\jenkinsWorkingDir\jobs\&lt;project name&gt;\workspace\trunk\&lt;module&gt;\target\&lt;artifact&gt;-jar-with-dependencies.jar.orig failed </code></pre> <p>Looking for a solution brought me to this blog entry: <a href="http://www.iliachemodanov.ru/en/blog-en/14-tools/maven/44-maven-assembly-plugin-bug-en" rel="nofollow">http://www.iliachemodanov.ru/en/blog-en/14-tools/maven/44-maven-assembly-plugin-bug-en</a></p> <p>Here the "maven-shade-plugin" was mentioned as a solution, so I give it a try. Reconfigured pom file but with the same effect. It seams that Windows or Tomcat or Jenkins keeps a file handle on the assembly and the jarsigner plugin is not able to rename it.</p> <p>So my answer for a possible solution. Any other more sophisticated solutions appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload