I am having single build.xml, Which is creating multiple WAR files for my project. I am doing migration from Ant build to maven build. How to create multiple WAR files from single pom.xml?
Asked
Active
Viewed 5,390 times
1
-
Use maven assembly plugin see http://stackoverflow.com/questions/1882322/how-do-i-get-maven-2-to-build-2-separate-war-files – Kalpesh Soni Mar 27 '17 at 16:12
2 Answers
1
I strongly suggest to build a multi module maven project, where each war is the output of a single module.
Look at the mini guide for multiple modules and this multimodule reference for more details.
I hope this helps.

Eldad Assis
- 10,464
- 11
- 52
- 78
-
But I want to create multiple WAR files for a single project. In my ant script Each WAR is created using different resource of the same project. And I want to do the same, by using Single pom.xml? Is there any way to do this? – user3564138 Apr 23 '14 at 12:45
-
You can do it as suggested by @Vinay Lodha, but it's not the maven way. Learn maven and use it as intended and don't warp it... – Eldad Assis Apr 23 '14 at 16:53
0
You can use build different maven profile to build each wars

Vinay Lodha
- 2,185
- 20
- 29
-
1It could be an alternative, but then you have to build for each profile, is there a possibility that you do mvn build once and it do for all the profiles ? – Tayab Hussain Jan 17 '19 at 12:35