This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to specify sterotype in pom.xml-jarsigner error: java.lang.RuntimeException:keystore load:Invali

 
Raghu Sha
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I got the certifcate which is having sterortype as pkcs12.
I need to add this into pom.xml.
I had given alias,storepass correctly except sterortype.
Getting error as jarsigner error: java.lang.RuntimeException: keystore load: Invalid keystore format

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>sign</id>
<phase>install</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<archiveDirectory>target/encrypte.jar</archiveDirectory>
<excludes>
<exclude>**/S*.jar</exclude>
</excludes>
<includes>
<include>**/*.jar</include>
</includes>
<keystore>src/main/resources/Cert.pfx</keystore>
<alias>myalias</alias>
<storepass>*****</storepass>
</configuration>
</plugin>
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have not explicitly specified the 'storetype' (not 'sterotype') as pkcs12 so the default store type is assumed (which as I would expect would seen not to be pkcs12). Read the Mavern documentation for the 'jarsigner:sign' plugin.
 
Raghu Sha
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,
I didnt used storetype.
Still i am getting jarsigner error: java.lang.RuntimeException: keystore load: Invalid keystore format.

Please let me know if i am missing anything.
Please modify the pom.xml
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raghu Sha wrote:
I didnt used storetype.l


Exactly - that is why the exception was thrown !!! You need to specify the 'storetype' as pkcs12 !!! The documentation tells you exactly how to do that.
 
Raghu Sha
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks..
It is working now after adding storetype.

How to specify signed jar location in pom.xml?
<signedjar>target/Signed.jar</signedjar>

After that only i can make sure jar is signed.

I am referring
http://www.baselogic.com/blog/development/maven/invalid-keystore-format-and-keytool-genkey-issues-during-jar-signing/
But signedjar tag not available in below link
http://maven.apache.org/plugins/maven-jarsigner-plugin/sign-mojo.html
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have lost me. There is no 'signedjar' element in jarsigner:sign specification. For both signing and verifying the jar is specified using the 'archive' and 'achiveDirectory' elements (the first two in http://maven.apache.org/plugins/maven-jarsigner-plugin/sign-mojo.html ).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic