Search code examples
javajakarta-eemavenmaven-assembly-plugin

Creating a ZIP file of an EAR with Maven


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 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


Solution

  • 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.