title: How to package nested maven modules for full product suite build
body: <p>At our company, we typically build an number of flex client applications, for numerous different clients.  Each Flex application typically loads at runtime, a differing variety of standalone Flex Module swfs as well.</p>
  
  <p>I'm trying to Mavenise the project, but am confused as how to progress.  The directory structure is pretty much flat, but I can't figure in my head how to tier the poms in order to be able to build from any position in the hierarchy.</p>
  
  <p>The structure might be as follows:</p>
  
  <pre><code>Client1 - pom.xml
  -App1 - pom.xml
  -App2 - pom.xml
  -App3 - pom.xml
  -Module1 - pom.xml
  -Module2 - pom.xml
  
  Client2 - pom.xml
  -App1 - pom.xml
  -App2 - pom.xml
  -Module1 - pom.xml
  -module2 - pom.xml
  -Module3 - pom.xml
  </code></pre>
  
  <p>The problems is that, if I want to build say Client2/App1 and all of it's dependent modules (ie. Client2/Module1 &amp; Client2/Module2).  Of course I can declare:</p>
  
  <pre><code>&lt;modules&gt;
     &lt;module&gt;Module1&lt;/module&gt;
     &lt;module&gt;Module2&lt;/module&gt;
  &lt;/modules&gt;
  </code></pre>
  
  <p>inside of the Client2/App1/pom.xml, specifying the package as 'pom', but this doesn't allow to actually compile the swf for Client2/App1 itself.  </p>
  
  <p>I could just package Client2/App1 as swf and have it build the Client2/App1.swf itself, and declare in Client2/pom.xml:</p>
  
  <pre><code>&lt;modules&gt;
     &lt;module&gt;App1&lt;/module&gt;
     &lt;module&gt;Module1&lt;/module&gt;
     &lt;module&gt;Module2&lt;/module&gt;
  &lt;/modules&gt;
  </code></pre>
  
  <p>but would like the option of building Client2/App2 independently as well, or any other application for that matter.</p>
  
  <p><strong>1)</strong> Could I setup different modules declarations using profiles perhaps in order to facilitate arbitrary client builds? </p>
  
  <p><strong>2)</strong> Is there another way to nest poms, with the aggregator level pom also executing some compilation goal as well? </p>
  
  <p><strong>3)</strong> I've seen you can add additional poms using a name other than pom at the same level to facilitate this, but it seems I can't include those poms in the  declaration.</p>
  
  <p>Any help/ideas appreciated.</p>