Situation is pretty straightforward. I have a Java webapp that I\'m converting to be built with Maven. At present, the app is built with Ant into a single WAR file, which is the
I know this is 5 years old now, but it was still the first answer that came up when I searched. Also, whilst "that's not the maven way" is a perfectly reasonable answer for some people, others may still prefer to use a single pom as the OP asked, and it is really not that complicated.
First, create a standard war pom.xml to generate the war file you want to include in the ear. Leave the packaging as war.
Then write your own application.xml (in src/main/application or wherever) using a placeholder for the war file name:
${project.build.finalName}.war
myapp
And include any other server-specific xml files (weblogic-application.xml etc.) in the same location.
Next, add a resources section to replace the placeholder with the war file name:
src/main/application
true
META-INF/*.xml
Finally, add an ant ear task to built the ear:
maven-antrun-plugin
package
run
And that's it.