title: Running muliple profiles in maven to build zip but facing some dependency issue
body: <p>I am trying create 2 zip files one for testing and other for production.
  pom.xml looks like below.</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.abc&lt;/groupId&gt;
      &lt;version&gt;1.0.0&lt;/version&gt;
      &lt;artifactId&gt;abc&lt;/artifactId&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
  
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;a.abc&lt;/groupId&gt;
                  &lt;artifactId&gt;abc1&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0&lt;/version&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;a.abc&lt;/groupId&gt;
                  &lt;artifactId&gt;abc2&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0&lt;/version&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;a.abc&lt;/groupId&gt;
                  &lt;artifactId&gt;abc3&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;b.xyz&lt;/groupId&gt;
                  &lt;artifactId&gt;xyz1&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0&lt;/version&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;b.xyz&lt;/groupId&gt;
                  &lt;artifactId&gt;xyz2&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0&lt;/version&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;b.xyz&lt;/groupId&gt;
                  &lt;artifactId&gt;xyz3&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0&lt;/version&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
      &lt;build&gt;
          &lt;finalName&gt;app-${project.version}&lt;/finalName&gt;
      &lt;/build&gt;
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;test&lt;/id&gt;
              &lt;activation&gt;
                  &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;/activation&gt;
              &lt;build&gt;
                  &lt;plugins&gt;
                      &lt;plugin&gt;
                          &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                          &lt;version&gt;2.4&lt;/version&gt;
                          &lt;configuration&gt;
                              &lt;appendAssemblyId&gt;true&lt;/appendAssemblyId&gt;
                              &lt;!-- &lt;finalName&gt;${project.name}&lt;/finalName&gt; --&gt;
                          &lt;/configuration&gt;
                          &lt;executions&gt;
                              &lt;execution&gt;
                                  &lt;id&gt;app-package-test&lt;/id&gt;
                                  &lt;phase&gt;package&lt;/phase&gt;
                                  &lt;goals&gt;
                                      &lt;goal&gt;single&lt;/goal&gt;
                                  &lt;/goals&gt;
                                  &lt;configuration&gt;
                                      &lt;descriptor&gt;src/main/assembly/test-descriptor.xml&lt;/descriptor&gt;
                                  &lt;/configuration&gt;
                              &lt;/execution&gt;
                          &lt;/executions&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
  
              &lt;/build&gt;
  
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;a.abc&lt;/groupId&gt;
                      &lt;artifactId&gt;abc1&lt;/artifactId&gt;
                      &lt;version&gt;1.0.0&lt;/version&gt;
                  &lt;/dependency&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;a.abc&lt;/groupId&gt;
                      &lt;artifactId&gt;abc2&lt;/artifactId&gt;
                      &lt;version&gt;1.0.0&lt;/version&gt;
                  &lt;/dependency&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;a.abc&lt;/groupId&gt;
                      &lt;artifactId&gt;abc3&lt;/artifactId&gt;
                      &lt;version&gt;1.0.0&lt;/version&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
          &lt;/profile&gt;
          &lt;profile&gt;
              &lt;id&gt;production&lt;/id&gt;
              &lt;activation&gt;
                  &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;/activation&gt;
              &lt;build&gt;
                  &lt;plugins&gt;
                      &lt;plugin&gt;
                          &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                          &lt;version&gt;2.4&lt;/version&gt;
                          &lt;configuration&gt;
                              &lt;appendAssemblyId&gt;true&lt;/appendAssemblyId&gt;
                              &lt;finalName&gt;${project.name}&lt;/finalName&gt;
                          &lt;/configuration&gt;
                          &lt;executions&gt;
                              &lt;execution&gt;
                                  &lt;id&gt;app-package-production&lt;/id&gt;
                                  &lt;phase&gt;package&lt;/phase&gt;
                                  &lt;goals&gt;
                                      &lt;goal&gt;single&lt;/goal&gt;
                                  &lt;/goals&gt;
                                  &lt;configuration&gt;
                                      &lt;descriptor&gt;src/main/assembly/production-descriptor.xml&lt;/descriptor&gt;
                                  &lt;/configuration&gt;
                              &lt;/execution&gt;
                          &lt;/executions&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
              &lt;/build&gt;
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;b.xyz&lt;/groupId&gt;
                      &lt;artifactId&gt;xyz1&lt;/artifactId&gt;
                      &lt;version&gt;1.0.0&lt;/version&gt;
                  &lt;/dependency&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;b.xyz&lt;/groupId&gt;
                      &lt;artifactId&gt;xyz2&lt;/artifactId&gt;
                      &lt;version&gt;1.0.0&lt;/version&gt;
                  &lt;/dependency&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;b.xyz&lt;/groupId&gt;
                      &lt;artifactId&gt;xyz3&lt;/artifactId&gt;
                      &lt;version&gt;1.0.0&lt;/version&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>But when I run <strong><em>mvn clean install</em></strong> it will build both profile since</p>
  
  <pre><code>&lt;activation&gt;
         &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
  &lt;/activation&gt;
  </code></pre>
  
  <p>But final bundled zip contains both dependencies of profile <strong><em>test</em></strong> and <strong><em>production</em></strong></p>
  
  <p>I need zip generated by profile <strong><em>test</em></strong> to have dependencies related to <strong><em>test</em></strong> profile and zip generated by profile <strong><em>production</em></strong> to have dependencies related to <strong><em>production</em></strong> profile.</p>
  
  <p>Anyone know why this is happening?</p>