Chocksmith
Chocksmith

Reputation: 1208

webstart-maven-plugin jarsigner fails with invalid SHA1 signature file digest

I have been struggling to make webstart-maven-plugin work with a real certificate. I definitively need help.

Everything was working nice while I was self-signing the JNLP jar. To get rid of the Oracle's security alert while starting the app, we've bought a certificate. (By the way, it is expensive!)

I configured the keystone and changed the POM to sign my app with the new certificate and now I'm getting:

[info] jarsigner: java.lang.SecurityException: invalid SHA1 signature file digest for OSGI-OPT/src/org/osgi/framework/PackagePermission.java

The plugin configuration is:

        <plugin>
            <groupId>org.codehaus.mojo.webstart</groupId>
            <artifactId>webstart-maven-plugin</artifactId>
            <executions>
                <execution>
                    <!-- bind to phase, I prefer to call it manualls -->
                    <phase>package</phase>
                    <goals>
                        <goal>jnlp-inline</goal> <!-- use jnlp, jnlp-inline or jnlp-single as appropriate -->
                    </goals>
                </execution>
            </executions>
            <configuration>
                <excludeTransitive>false</excludeTransitive>
                <libPath>lib</libPath>
                <outputJarVersions>true</outputJarVersions>
                <dependencies>
                </dependencies>

                <jnlp>
                    <outputFile>mix.jnlp</outputFile> 
                    <mainClass>${my_main_class}</mainClass>
                </jnlp>

                <sign>
                    <keystore>${basedir}/NitryxKeyStore</keystore>
                    <keypass>${keypass}</keypass> 
                    <storepass>${storepass}</storepass>
                    <alias>codesigncert</alias>

                    <verify>true</verify> 

                    <!-- KEYSTORE MANAGEMENT -->
                    <keystoreConfig>
                        <delete>false</delete>
                        <gen>false</gen>
                    </keystoreConfig>
                </sign>

                <pack200>true</pack200>
                <gzip>true</gzip> 

                <outputJarVersions>false</outputJarVersions>

                <verbose>true</verbose>
            </configuration>
        </plugin>

When I run the "mvm clean package", it successfully sign lots of packages like log4j, javamail, my program itself, but when it tries to sign the org.osgi.core-4.0.0.jar it fails:

...
[INFO]   signing: org/osgi/service/url/URLConstants.class
[INFO]   signing: org/osgi/service/url/URLStreamHandlerService.class
[INFO]   signing: org/osgi/service/url/URLStreamHandlerSetter.class
[INFO]   signing: org/osgi/service/url/packageinfo
[debug] jarsigner executable [/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre/bin/jarsigner]
[debug] Executing: /bin/sh -c "cd /Users/rodrigo/Documents/Nitryx/Technical/Projects/Nitryx-Mix/mix-wstart/target/jnlp && /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre/bin/jarsigner -verify -verbose /Users/rodrigo/Documents/Nitryx/Technical/Projects/Nitryx-Mix/mix-wstart/target/jnlp/lib/org.osgi.core-4.0.0.jar"
[info] jarsigner: java.lang.SecurityException: invalid SHA1 signature file digest for OSGI-OPT/src/org/osgi/framework/PackagePermission.java

I spent hours googling and it seems that it has something to do with signing twice the jar or a pack200 bug. I would appreciate any help you could offer.

Tks

Upvotes: 0

Views: 979

Answers (1)

Chocksmith
Chocksmith

Reputation: 1208

I solved this problem manually opening the problematic .jar and removing the manifest

Upvotes: 1

Related Questions