File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
Author

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

Joined: Jun 24, 2003
Posts: 3274
    
    5

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Mutiple war files from single POM
 
Similar Threads
new to maven, error in mvn war:war
Maven and POM file
How to put jar after creating it in war file's lib through Maven
How do I create ".pom" files? (not pom.xml files)
Do you need Maven if you are using an IDE