Pages

Need Java Distribution ? Here we go :)

In this post I will show you how to create Java distribution package in zip and tar.gz. To demonstrate this we use simple maven project. (Need a basic understanding about maven :) )

1. Create a simple maven project

  • mvn archetype:generate to create a sample maven project.
  • Select simple maven project that will create project.
2. Create a directory name assembly under main directory. Also create a distribution.xml file in it.This is the file that will create .zip and .tar.gz formats.


3.Add maven plugin to create distribution directories.



  • Change <mainclass>{add your main class}</mainclass>  and add your main class.
4. Run mvn clean install from your project and it will create both .zip and .tar.gz distribution under your <project>/target directory. Unzip the directory and you can see under the bin folder you have the all the execution file (windows and linux)

No comments:

Post a Comment