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
In Maven every single project produce an aritifact. In your situation I suggest create two project one for war and one for ear. If you need mutltiple versions of your projects you can achive that using classifiers and profiles.
This is excerpt of richfaces examples pom.
maven-war-plugin
jee5
package
war
${project.build.directory}/${project.build.finalName}-jee5
jee5
WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/el-*
WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/el-*
tomcat6
package
war
${project.build.directory}/${project.build.finalName}-tomcat6
tomcat6
WEB-INF/lib/el-*
WEB-INF/lib/el-*
${basedir}/src/main/java
/WEB-INF/src
In your ear pom use profiles to import required dependency with appropriate classifier.
jee5
org.richfaces.samples
richfaces-demo
${richfaces-version}
jee5
war
runtime