This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Mutiple war files from single POM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Mutiple war files from single POM" Watch "Mutiple war files from single POM" New topic

Mutiple war files from single POM

Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
Hi All

I am quite new to maven and seek a help. Is it possible that from maven i am able to build 2 sets of jars and create 2 war files one with each set of jar? The problem is that I want to create the 2 war files using a single POM
Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

Hi Dorothy,

In short: Not with one pom.xml. Maven is a "One Artifact per POM" mechanism. You'll need to have a separate pom for your other WAR.

Note: You can use a parent pom to list the two JAR and 2 WAR poms so that you can build them all in one go...

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
Actually, it is possible, but only one of them would be referable by other project as dependency.
The simplest way would be to define multiple executions for plugins in the build section.
It s just not recommended practice.
I agree. Here's the link:
subject: Mutiple war files from single POM
It's not a secret anymore!