Monday, December 12, 2016

Java Web Start Bundling jars/configuration files as one and handling versioning and auto update

Creating a single Jar

Here we are going to put all the project dependent jar files in build path of the main project which is having main entry class of our application.

Eg. In below screen we have Demo1 and Demo2, two dependent/ reference jar files and Test.java is the main entry class of our project which is using these jars.




We will create jar of JWSDemo project as Test.jar and we will be signing only this jar. Below are the steps to export main project including reference jars
Select  Runnable JAR file.




Select  highlighted options as in immediate below screen.





Click Finish.

By doing this, we need to handle versioning of the main jar not the reference jars. If there would be any change or update in any jar, it will get downloaded automatically after implementing versioning on main jar.


Creating jar of configuration files:

Below scree shows the configuration jar (conf__V1.1.jar) having multiple configuration files in it.






Steps to implement :
    1.     Select all the configuration files you want to be in a jar and export as a jar.


    











    





By default, jar will get created in you workspace folder.

    1.     Rename it to conf__V1.0.jar for version implementation and sign it as we did in signing jar steps earlier in this document.

    2.     After signing, put it in your main project or in build path and export your main project jar and rename it to a version number and sign the project jar.

3.     If you have any change to do in configuration file, then update you change and repeat step 1 to 4.But during repeating the steps maintain version names of jar files.

4.     Below screen show how to use configuration file in our project classes.






1.     Do mention the configuration jar in the servlet where we are creating dynamic JNLP as in below screen.






Thanks!!! Keep Learning !!! Keep Sharing !!!










No comments:

Post a Comment

Fixing yum command on linux

You may find yourself having to fix more packages. So you can just remove everything you had installed via  pip and reinstall everythin...