开发者

Creating a ZIP file of an EAR with Maven

开发者 https://www.devze.com 2023-02-27 10:48 出处:网络
I\'m got a pretty simple question... I have a Maven 3 project set up like so: Root POM project - EAR project: depends on the WAR project

I'm got a pretty simple question... I have a Maven 3 project set up like so:

Root POM project - EAR project: depends on the WAR project - WAR project

I'd like 开发者_JS百科to use the assembly plug-in to make a ZIP file containing the exploded EAR (which contains the WAR). Any suggestions on how I should do this? Should I put the assembly configuration details in the root .pom or EAR .pom?

Thanks! -Jon


You could have a third project, say earzip, with a dependency on the ear project. This project can have the necessary configuration (assembly descriptor and other plugin definitions as required) to explode the ear and zip it up again as suitable. This will keep your parent pom clean, as well as not put multiple things in your ear pom.


When I was looking for the way to run batch script from ant (~1 year ago) I found only the following solution:

  1. In the pom that builds your parent project add runant plugin
  2. In the ant script (1) add target that runs a batch script (if on Windows)
  3. In the batch script (2) add archiving task.

No point to add zipping task to the pom that builds an EAR (IMHO). It should be parent pom task.

I hope that these threee would do the magic.

Good luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消