title: Maven profiles in modules
body: <p>I have a Maven Java EE project with several modules.</p>
  
  <pre><code>PROJECT
   --EJB
   --WEB1
   --WEB2
   --EAR
  </code></pre>
  
  <p>Now I want to create a profile which compile and include WEB1 and one profile which include both</p>
  
  <p>To exclude/include the module from the build, I include the wanted sub-modules in the main pom.xml according to the selected profile. This works fine.</p>
  
  <p>The problem is the dependencies in the EAR module.</p>
  
  <p>How do I exclude either the module WEB1 or WEB2. Redefine the profiles part don't work.</p>
  
  <p>The question is: Is there a way to control the dependencies in a module of a project, according to the selected profile</p>
  
  <p>EDIT:</p>
  
  <p>My fault, I have create the  tags in the  instead as direct in the root </p>