简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM