title: In Maven2, what's the simplest way to build a WAR and the EAR to contain that WAR in a single POM?
body: <p>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 then bundled into an EAR with a very simple application.xml.</p>
  
  <p><code>maven-war-plugin</code> and <code>maven-ear-plugin</code> both look pretty straightforward to me, and it appears they're setting me up to be forced to consider the above as two distinct projects, with the WAR project as a dependency of the EAR project. This seems a tad inconvenient, especially because a profile setting of the WAR project will change for each environment, which seems like it would force me to duplicate that build tweaking each time I attempted to build the EAR as well.</p>
  
  <p>All of that to say: is there a straightforward way to build the WAR and package that into this trivially-simple EAR? I'd like to avoid maintaining these as two separate projects, but would similarly prefer not to resort to an overly messy hack using assemblies to accomplish this.</p>