How to sign JAR by java keystore and Maven

This post describes how can you sign your JAR files by maven and JAVA keystore.

Applet_Java_Signed_Stamp

[wp_ad_camp_1]

 

Prepare JKS keystore

Generate self-signed certificate

If you don’t have any personal certificate you can generate on by this command

keytool -genkey -alias my_certificate_alias -keyalg RSA -keysize 4096 -keystore keystore.jks

Substitute „my_certificate_alias“ by you own alias in command.

Follow the wizard.

Import existing certificate

If you have an existing personal certificate (in PFX format)  you can import it to keystore by following commands.

keytool -importkeystore -srckeystore mypfxfile.pfx -srcstoretype pkcs12 -destkeystore keystore.jks -deststoretype JKS

 

[wp_ad_camp_1]

 

Modify you pom.xml file

Add these lines to your project pom.xml file

<project>
   ...
   <build>
      ...
      <plugins>
         ...
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jarsigner-plugin</artifactId>
            <version>1.4</version>
            <executions>
               <execution>
                  <id>sign</id>
                    <goals>
                       <goal>sign</goal>
                    </goals>
               </execution>
               <execution>
                 <id>make-assembly</id>
                 <phase>package</phase>
                 <goals>
                    <goal>sign</goal>
                 </goals>
               </execution>
            </executions>
            <configuration>
               <keystore>${keystore.path}</keystore>
               <alias>${keystore.alias}</alias>
               <storepass>${keystore.password}</storepass>
               <keypass>${keystore.password}</keypass>
            </configuration>
         </plugin>
      </plugins>
   </build>
</project>

 

[wp_ad_camp_1]

 

Compile and sign JARs by MAVEN


Go to your project root folder (where is located pom.xml) and run command.  Don’t forgot modify KEY_STORE_PASSWORD, PATH_TO_JKS_FILE and PATH_TO_JKS_FILE by your current settings.

mvn clean package -Dkeystore.password=KEY_STORE_PASSWORD -Dkeystore.path=PATH_TO_JKS_FILE -Dkeystore.alias=CERTIFICATE_ALIAS


[wp_ad_camp_1]

98 thoughts to “How to sign JAR by java keystore and Maven”

  1. Hi there very cool website!! Man .. Excellent .. Wonderful .. I will bookmark your web site and take the feeds also…I am glad to seek out a lot of helpful info right here in the submit, we want develop more strategies in this regard, thanks for sharing. . . . . .

  2. „Today, I went to the beachfront with my kids. I found a sea shell and gave it to my 4 year old daughter and said You can hear the ocean if you put this to your ear.“ She put the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is completely off topic but I had to tell someone!““

  3. Howdy would you mind sharing which blog platform you’re working with?
    I’m going to start my own blog in the near future but
    I’m having a difficult time selecting between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your layout seems different then most blogs and I’m looking for something unique.
    P.S Sorry for getting off-topic but I had to
    ask!

  4. magnificent post, very informative. I wonder why
    the other experts of this sector do not notice this.
    You must proceed your writing. I am sure, you’ve a
    huge readers‘ baae already!

  5. hi!,I really like your writing so so much! percentage we be in contact more about your post
    on AOL? I need an expert on this house to solve my
    problem. May be that is you! Taking a look forward to
    peer you.

  6. You’re in some serious need of relaxation. That’s where a site like http://www.camgirl.pw comes in handy. You can do a whole lot of relaxing there. You’ll find plenty of fun girls to talk to. These are the hottest and most wild girls on the internet. Chat with them and have yourself a good time.

  7. Good! Interesting informations over this website. It’s pretty worth enough for me. In my opinion, if all web owners and bloggers made good content as you did, the internet will be much more useful than ever before.| I could not resist commenting. I ‚ve spent some time trying to find such infos. I will also share it with a couple of friends interested in it. I have just bookmarked this website. Finished with the search done, I going to enjoy some Russia model Cams. Thank you very much!! Regards from Mundial 2018!

  8. Today, while I was at work, my sister stole my iPad
    and tested to see if it can survive a forty foot
    drop, just so she can be a youtube sensation. My iPad is now broken and she has 83 views.
    I know tthis is commpletely off topic but I had too share it with someone!

  9. Thanks for your submission. I also think that laptop computers are getting to be more and more popular lately, and now in many cases are the only sort of computer found in a household. This is due to the fact that at the same time potentially they are becoming more and more reasonably priced, their working power is growing to the point where they’re as effective as desktop out of just a few years ago.

  10. I have seen a great deal of useful elements on your web site about computer systems. However, I’ve the view that lap tops are still less than powerful adequately to be a good choice if you frequently do things that require a great deal of power, like video modifying. But for net surfing, microsoft word processing, and most other prevalent computer functions they are perfectly, provided you never mind the screen size. Many thanks for sharing your opinions.

  11. Hello there friend! Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content from other writers and practice a little something from their store. I?d prefer to use some with the content on my blog whether you don?t mind. Natually I?ll give you a link on your web blog. Thanks for sharing. Again thanks alot for this!

  12. I have really learned new things by your web site. One other thing I’d like to say is the fact that newer computer system operating systems tend to allow additional memory for use, but they likewise demand more memory simply to perform. If an individual’s computer cannot handle additional memory along with the newest computer software requires that memory increase, it is usually the time to shop for a new Computer system. Thanks

  13. I’ve learned new things via your weblog. One other thing I would like to say is newer laptop or computer operating systems are inclined to allow additional memory to be played with, but they furthermore demand more ram simply to operate. If people’s computer can not handle additional memory as well as the newest application requires that memory increase, it can be the time to buy a new Computer. Thanks

  14. Interesting blog post. A few things i would like to add is that computer memory is required to be purchased if your computer still cannot cope with everything you do with it. One can install two random access memory boards containing 1GB each, for example, but not one of 1GB and one with 2GB. One should always check the car maker’s documentation for one’s PC to be certain what type of memory is essential.

  15. I have really learned new things by means of your blog site. One other thing I would like to say is that often newer laptop or computer os’s usually allow much more memory to use, but they additionally demand more storage simply to function. If someone’s computer could not handle far more memory along with the newest software program requires that storage increase, it can be the time to shop for a new Personal computer. Thanks

  16. I have really learned newer and more effective things by your weblog. One other thing I want to say is the fact that newer computer os’s often allow much more memory for use, but they as well demand more ram simply to function. If a person’s computer could not handle extra memory as well as newest program requires that storage increase, it might be the time to shop for a new Personal computer. Thanks

  17. Thanks for making me to gain new ideas about computer systems. I also hold the belief that certain of the best ways to help keep your mobile computer in perfect condition is by using a hard plastic case, or shell, which fits over the top of one’s computer. A majority of these protective gear tend to be model precise since they are manufactured to fit perfectly within the natural casing. You can buy all of them directly from the owner, or from third party sources if they are designed for your laptop, however its not all laptop will have a spend on the market. Once more, thanks for your suggestions.

  18. One thing I’d prefer to say is before acquiring more personal computer memory, look into the machine directly into which it would be installed. In the event the machine will be running Windows XP, for instance, the particular memory limit is 3.25GB. Setting up more than this would purely constitute some sort of waste. Make certain that one’s mother board can handle the particular upgrade amount, as well. Good blog post.

  19. I have seen loads of useful elements on your web site about pc’s. However, I’ve the view that lap tops are still less than powerful enough to be a sensible choice if you normally do tasks that require many power, including video editing. But for web surfing, statement processing, and most other frequent computer work they are perfectly, provided you do not mind your little friend screen size. Many thanks sharing your notions.

  20. One thing I’d like to say is that often before obtaining more computer system memory, check out the machine within which it could well be installed. In case the machine can be running Windows XP, for instance, a memory limit is 3.25GB. Putting in more than this would merely constitute a new waste. Make certain that one’s mother board can handle the actual upgrade amount, as well. Good blog post.

  21. I have really learned newer and more effective things by means of your web site. One other thing I would like to say is newer computer system operating systems have a tendency to allow additional memory to be played with, but they also demand more ram simply to work. If an individual’s computer is unable to handle extra memory as well as the newest computer software requires that memory increase, it usually is the time to shop for a new PC. Thanks

  22. In these days of austerity along with relative stress and anxiety about getting debt, many individuals balk about the idea of making use of a credit card to make acquisition of merchandise or maybe pay for a vacation, preferring, instead only to rely on this tried as well as trusted method of making payment – hard cash. However, if you’ve got the cash on hand to make the purchase in full, then, paradoxically, that is the best time to be able to use the cards for several good reasons.

  23. Right here is thee perfect webpage for everyone
    who would like to understand this topic. You knw a whole lot
    its almost hardd to argue with you (not thbat I actually would want to…HaHa).
    You definitely put a new spin on a topic that’s been discussed
    for years. Wonderful stuff, just wonderful!

  24. My husband and i got quite satisfied that Edward could finish off his researching from your precious recommendations he discovered from your own web pages. It’s not at all simplistic to simply possibly be giving out steps that many men and women have been making money from. And we keep in mind we need the blog owner to thank for that. All the illustrations you made, the straightforward site menu, the relationships you will aid to instill – it’s most spectacular, and it’s really aiding our son in addition to us recognize that that topic is amusing, and that’s highly fundamental. Thank you for all!

  25. I precisely needed to thank you so much all over again. I do not know what I could possibly have gone through without the ideas shared by you on such area. This has been the depressing matter for me, nevertheless being able to see the very skilled approach you dealt with it took me to cry with delight. I am just grateful for your information and as well , sincerely hope you know what an amazing job you were undertaking instructing other individuals by way of your webblog. Most probably you have never encountered any of us.

  26. Pingback: tits
  27. Thank you a lot for giving everyone an extraordinarily remarkable chance to discover important secrets from this blog. It really is so pleasurable and jam-packed with fun for me personally and my office co-workers to visit the blog particularly thrice every week to see the new tips you will have. And of course, I am at all times contented for the remarkable tips and hints you give. Certain 2 ideas in this article are in reality the finest I have ever had.

Napsat komentář

Vaše emailová adresa nebude zveřejněna. Vyžadované informace jsou označeny *