ps-aux
ps-aux

Reputation: 12146

Maven assembly create jar with dependencies and then create zip and tar.gz file

I would like to do the following with the maven:

  1. Pack my code & dependencies to uber jar
  2. Attach a script to it (either Windows script or Linux script)
  3. Put both script and jar to a folder
  4. Crate zip for Windows AND tar.gz file for Linux

Is this possible in Maven using assembly or any other plugin?

Upvotes: 0

Views: 719

Answers (1)

Absurd-Mind
Absurd-Mind

Reputation: 7994

i would split this into two projects and for convenience a parent module, like this:

projectX
|- codeproject
|- packingproject
\- pom.xml

codeproject:

  • Nothing special here, just create your über-jar

packagingproject:

parent pom:

  • also, nothing special, just add both modules

Note:

be sure to call install on your codeproject so that the jar gets copied to your local maven repository, otherwise you may end with a file not found or an old version of your code.

Upvotes: 1

Related Questions