Closed MNeuling closed 7 months ago
What kind of keystore do you use? Could you copy the stacktrace please?
It is a PKCS12 keystore. app.storetype=pkcs12 app.signalg=SHA-256 app.tsaurl=http://timestamp.comodoca.com/rfc3161 app.tsmode=RFC3161
This is the stacktrace from the error log.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:3.0.0:run (default) on project cd-exec: An Ant BuildException has occured: No certificate found in the keystore E:\jarsigning\CodeSigning.pfx
[ERROR] around Ant part ...<jsign file="E:\git\app\exec\target/package/App.exe" storetype="pkcs12" storepass="..." name="App" alias="appstart-cert2020" tsaurl="http://timestamp.comodoca.com/rfc3161" keystore="E:/jarsigning
/CodeSigning.pfx" tsmode="RFC3161" alg="SHA-256" url="http://www.mysite.com" />... @ 60:356 in E:\git\app\exec\target\antrun\build-main.xml
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:3.0.0:run (default) on project cd-exec: An Ant BuildException has occured: No certificate found in the keystore E:\jarsigning\CodeSigning.pfx
around Ant part ...<jsign file="E:\git\app\exec\target/package/App.exe" storetype="pkcs12" storepass="..." name="App" alias="app-cert2020" tsaurl="http://timestamp.comodoca.com/rfc3161" keystore="E:/jarsigning/CodeSigning.pfx" tsmode="RFC3161" alg="SHA-256" url="http://www.mysite.com" />... @ 60:356 in E:\git\app\exec\target\antrun\build-main.xml
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: An Ant BuildException has occured: No certificate found in the keystore E:\jarsigning\CodeSigning.pfx
around Ant part ...<jsign file="E:\git\app\exec\target/package/App.exe" storetype="pkcs12" storepass="..." name="App" alias="app-cert2020" tsaurl="http://timestamp.comodoca.com/rfc3161" keystore="E:/jarsigning/CodeSigning.pfx" tsmode="RFC3161" alg="SHA-256" url="http://www.mysite.com" />... @ 60:356 in E:\git\app\exec\target\antrun\build-main.xml
at org.apache.maven.plugins.antrun.AntRunMojo.execute (AntRunMojo.java:308)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.tools.ant.BuildException: No certificate found in the keystore E:\jarsigning\CodeSigning.pfx
at net.jsign.JsignTask.execute (JsignTask.java:183)
at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:299)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform (Task.java:350)
at org.apache.tools.ant.taskdefs.Sequential$$Lambda$114/0x0000000000000000.accept (Unknown Source)
at java.util.Vector.forEach (Vector.java:1277)
at org.apache.tools.ant.taskdefs.Sequential.execute (Sequential.java:67)
at net.sf.antcontrib.logic.IfTask.execute (IfTask.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:99)
at org.apache.tools.ant.TaskAdapter.execute (TaskAdapter.java:155)
at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:299)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform (Task.java:350)
at org.apache.tools.ant.Target.execute (Target.java:449)
at org.apache.tools.ant.Target.performTasks (Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets (Project.java:1401)
at org.apache.tools.ant.Project.executeTarget (Project.java:1374)
at org.apache.maven.plugins.antrun.AntRunMojo.execute (AntRunMojo.java:287)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: net.jsign.SignerException: No certificate found in the keystore E:\jarsigning\CodeSigning.pfx
at net.jsign.SignerHelper.build (SignerHelper.java:385)
at net.jsign.SignerHelper.sign (SignerHelper.java:500)
at net.jsign.JsignTask.execute (JsignTask.java:181)
at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:299)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform (Task.java:350)
at org.apache.tools.ant.taskdefs.Sequential$$Lambda$114/0x0000000000000000.accept (Unknown Source)
at java.util.Vector.forEach (Vector.java:1277)
at org.apache.tools.ant.taskdefs.Sequential.execute (Sequential.java:67)
at net.sf.antcontrib.logic.IfTask.execute (IfTask.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:99)
at org.apache.tools.ant.TaskAdapter.execute (TaskAdapter.java:155)
at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:299)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform (Task.java:350)
at org.apache.tools.ant.Target.execute (Target.java:449)
at org.apache.tools.ant.Target.performTasks (Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets (Project.java:1401)
at org.apache.tools.ant.Project.executeTarget (Project.java:1374)
at org.apache.maven.plugins.antrun.AntRunMojo.execute (AntRunMojo.java:287)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
@ebourg Are there any news solving the problem? I've tried also version 4.1 and 4.2 but it still doesn't work.
And it works with Jsign 3.1 with the exact same keystore?
Yes, it works. Without exception and no further problems. Only since Version 4.x the exception occurs.
Did you try with a relative path instead of an absolute path when specifying the location of the keystore file?
@MNeuling What is the output of keytool -list -keystore E:\jarsigning\CodeSigning.pfx
?
Now I found out what the problem is. Since version 4.0 the value of property app.storetype must be uppercase.
If you use app.storetype=pkcs12
the exception occurs.
If you use app.storetype=PKCS12
everything works fine.
That's a regression, I'll fix it.
Also recent versions will report the storetype is incorrect:
java.lang.IllegalArgumentException: Unknown keystore type 'pkcs12' (expected types: JKS, JCEKS, PKCS12, PKCS11, OPENPGP, OPENSC, PIV, NITROKEY, YUBIKEY, AWS, AZUREKEYVAULT, DIGICERTONE, ESIGNER, GOOGLECLOUD, HASHICORPVAULT, ETOKEN)
This is the ant task. After changing the JSign version from 3.1 to 4.0 the error occurs.