1

I would like to create a ZIP distributable for my java application with Maven with the following structure :

/lib -> my generated jars (several modules core.jar, app.jar ... )

/config -> several configuration files (app.properties, ...)

/3rdparty -> all jar dependencies (commons-lang.jar, log4j.jar ... )

/scripts -> helper scripts (start.sh ... )

I would like to deploy this in any client machine and run as :

java -cp ../lib:../3rdparty -Dprop.file=app.properties [main.class]

I have read quite a lot about the maven assembly plugin but have not found a satisfactory answer on how to ahcieve this.

kms333
  • 3,147
  • 7
  • 31
  • 39

2 Answers2

4

The Maven Assembly plugin is the right thing to use here. There's plenty of examples on how to use it out there, here are some:

Community
  • 1
  • 1
nwinkler
  • 52,665
  • 21
  • 154
  • 168
1

The are of the scripts folder with starting scripts can be done via the appassembler-maven-plugin which creates scripts for running/starting applications. To create a single archive which contains all that stuff you can use the maven-assembly-plugin.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235