title: How to ignore maven profiles in child module?
body: <p>I want to run the simple flow, I have 6 profiles:</p>
  
  <p><strong>generate-schema,unpack-war,run-jetty,test,stop-jetty,start-stop-app</strong></p>
  
  <p>the test profile will run on a different child module when I declare it in the mvn goals/properties: 
  <strong>* clean --activate-profiles generate-schema,unpack-war,start-stop-app,test --projects apm-tests,apm-tests\apm-adapter-tests verify.*</strong></p>
  
  <p>How can I make the child module run only the tests and skip the rest of the profiles (generate-schema and etc.) ?</p>
  
  <p><strong><em>Parent pom sample:</em></strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &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;project&gt;
  
          &lt;parent&gt;
              &lt;artifactId&gt;apm-root&lt;/artifactId&gt;
              &lt;groupId&gt;com.apm.platform&lt;/groupId&gt;
              &lt;version&gt;12.50.9999-SNAPSHOT&lt;/version&gt;
          &lt;/parent&gt;
          &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
          &lt;artifactId&gt;apm-tests&lt;/artifactId&gt;
  
          &lt;packaging&gt;pom&lt;/packaging&gt;
  
          &lt;modules&gt;
              &lt;module&gt;alm-coverage-report&lt;/module&gt;
          &lt;/modules&gt;
  
              &lt;profile&gt;
                  &lt;id&gt;test&lt;/id&gt;
                  &lt;build&gt;
                      &lt;plugins&gt;
                          &lt;plugin&gt;
                              &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                              &lt;configuration&gt;
                                  &lt;skipTests&gt;true&lt;/skipTests&gt;
                              &lt;/configuration&gt;
                          &lt;/plugin&gt;
                      &lt;/plugins&gt;
                  &lt;/build&gt;
              &lt;/profile&gt;
  
      &lt;profile&gt;
                  &lt;id&gt;generate-schema&lt;/id&gt;
                  &lt;activation&gt;
                      &lt;activeByDefault&gt;false&lt;/activeByDefault&gt;
                  &lt;/activation&gt;
  
                  &lt;build&gt;
                      &lt;plugins&gt;
                          &lt;plugin&gt;
                              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                              &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
                              &lt;executions&gt;
                                  &lt;execution&gt;
                                      &lt;id&gt;generate-schema&lt;/id&gt;
                                      &lt;phase&gt;pre-integration-test&lt;/phase&gt;
                                      &lt;goals&gt;
                                          &lt;goal&gt;java&lt;/goal&gt;
                                      &lt;/goals&gt;
                                      &lt;configuration&gt;
                                          &lt;mainClass&gt;com.apm.platform.siteadmin.setup.Setup&lt;/mainClass&gt;
                                          &lt;classpathScope&gt;test&lt;/classpathScope&gt;
                                          &lt;systemProperties&gt;
                                              &lt;systemProperty&gt;
                                                  &lt;key&gt;InstallationFolder&lt;/key&gt;
                                                  &lt;value&gt;${tests.runtime}&lt;/value&gt;
                                              &lt;/systemProperty&gt;
                                              &lt;systemProperty&gt;
                                                  &lt;key&gt;RepositoryFolder&lt;/key&gt;
                                                  &lt;value&gt;${tests.runtime}/repository&lt;/value&gt;
                                              &lt;/systemProperty&gt;
                                              &lt;systemProperty&gt;
                                                  &lt;key&gt;LogFolder&lt;/key&gt;
                                                  &lt;value&gt;${tests.runtime}/log&lt;/value&gt;
                                              &lt;/systemProperty&gt;
                                              &lt;systemProperty&gt;
                                                  &lt;key&gt;mercury.td.sa_config_dir&lt;/key&gt;
                                                  &lt;value&gt;${tests.runtime}&lt;/value&gt;
                                              &lt;/systemProperty&gt;
                                              &lt;systemProperty&gt;
                                                  &lt;key&gt;CreateLabProject&lt;/key&gt;
                                                  &lt;value&gt;${create.lab.project}&lt;/value&gt;
                                              &lt;/systemProperty&gt;
                                          &lt;/systemProperties&gt;
                                          &lt;arguments&gt;
                                              &lt;argument&gt;--auto&lt;/argument&gt;
                                              &lt;argument&gt;${db.schema}&lt;/argument&gt;
                                          &lt;/arguments&gt;
                                      &lt;/configuration&gt;
                                  &lt;/execution&gt;
                              &lt;/executions&gt;
                          &lt;/plugin&gt;
                      &lt;/plugins&gt;
                  &lt;/build&gt;
              &lt;/profile&gt;
              &lt;profile&gt;
                  &lt;id&gt;start-jetty&lt;/id&gt;
                  &lt;activation&gt;
                      &lt;activeByDefault&gt;false&lt;/activeByDefault&gt;
                  &lt;/activation&gt;
                  &lt;build&gt;
                      &lt;plugins&gt;
                          &lt;plugin&gt;
                              &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
                              &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
                              &lt;configuration&gt;
                                  &lt;war&gt;${unpacked.war.directory}&lt;/war&gt;
                                  &lt;contextXml&gt;${unpacked.war.directory}/WEB-INF/jetty-web.xml&lt;/contextXml&gt;
                                  &lt;webApp&gt;
                                      &lt;contextPath&gt;/qcbin&lt;/contextPath&gt;
                                  &lt;/webApp&gt;
                                  &lt;systemProperties&gt;
                                      &lt;systemProperty&gt;
                                          &lt;name&gt;mercury.td.sa_config_dir&lt;/name&gt;
                                          &lt;value&gt;${tests.runtime}&lt;/value&gt;
                                      &lt;/systemProperty&gt;
                                      &lt;systemProperty&gt;
                                          &lt;name&gt;jetty.port&lt;/name&gt;
                                          &lt;value&gt;${jetty.start.port}&lt;/value&gt;
                                      &lt;/systemProperty&gt;
                                  &lt;/systemProperties&gt;
                                  &lt;stopPort&gt;${jetty.stop.port}&lt;/stopPort&gt;
                                  &lt;stopKey&gt;STOP&lt;/stopKey&gt;
                              &lt;/configuration&gt;
                              &lt;executions&gt;
                                  &lt;execution&gt;
                                      &lt;id&gt;start-jetty&lt;/id&gt;
                                      &lt;phase&gt;pre-integration-test&lt;/phase&gt;
                                      &lt;goals&gt;
                                          &lt;goal&gt;deploy-war&lt;/goal&gt;
                                      &lt;/goals&gt;
                                      &lt;configuration&gt;
                                          &lt;scanIntervalSeconds&gt;0&lt;/scanIntervalSeconds&gt;
                                          &lt;daemon&gt;false&lt;/daemon&gt;
                                      &lt;/configuration&gt;
                                  &lt;/execution&gt;
                              &lt;/executions&gt;
                          &lt;/plugin&gt;
                      &lt;/plugins&gt;
                  &lt;/build&gt;
              &lt;/profile&gt;
  
            &lt;profile&gt;
              &lt;id&gt;start-stop-app&lt;/id&gt;
              &lt;activation&gt;
                  &lt;activeByDefault&gt;false&lt;/activeByDefault&gt;
              &lt;/activation&gt;
              &lt;build&gt;
                  &lt;plugins&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
                          &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
                          &lt;configuration&gt;
                              &lt;war&gt;${unpacked.war.directory}&lt;/war&gt;
                              &lt;contextXml&gt;${unpacked.war.directory}/WEB-INF/jetty-web.xml&lt;/contextXml&gt;
                              &lt;webApp&gt;
                                  &lt;contextPath&gt;/qcbin&lt;/contextPath&gt;
                              &lt;/webApp&gt;
                              &lt;systemProperties&gt;
                                  &lt;systemProperty&gt;
                                      &lt;name&gt;mercury.td.sa_config_dir&lt;/name&gt;
                                      &lt;value&gt;${tests.runtime}&lt;/value&gt;
                                  &lt;/systemProperty&gt;
                                  &lt;systemProperty&gt;
                                      &lt;name&gt;jetty.port&lt;/name&gt;
                                      &lt;value&gt;${jetty.start.port}&lt;/value&gt;
                                  &lt;/systemProperty&gt;
                              &lt;/systemProperties&gt;
                              &lt;stopPort&gt;${jetty.stop.port}&lt;/stopPort&gt;
                              &lt;stopKey&gt;STOP&lt;/stopKey&gt;
                          &lt;/configuration&gt;
                          &lt;executions&gt;
                              &lt;execution&gt;
                                  &lt;id&gt;start-jetty&lt;/id&gt;
                                  &lt;phase&gt;pre-integration-test&lt;/phase&gt;
                                  &lt;goals&gt;
                                      &lt;goal&gt;deploy-war&lt;/goal&gt;
                                  &lt;/goals&gt;
                                  &lt;configuration&gt;
                                      &lt;scanIntervalSeconds&gt;0&lt;/scanIntervalSeconds&gt;
                                      &lt;daemon&gt;true&lt;/daemon&gt;
                                  &lt;/configuration&gt;
                              &lt;/execution&gt;
                              &lt;execution&gt;
                                  &lt;id&gt;stop-jetty&lt;/id&gt;
                                  &lt;phase&gt;post-integration-test&lt;/phase&gt;
                                  &lt;goals&gt;
                                      &lt;goal&gt;stop&lt;/goal&gt;
                                  &lt;/goals&gt;
                              &lt;/execution&gt;
                          &lt;/executions&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
              &lt;/build&gt;
          &lt;/profile&gt;
  
              &lt;profile&gt;
                  &lt;id&gt;stop-jetty&lt;/id&gt;
                  &lt;activation&gt;
                      &lt;activeByDefault&gt;false&lt;/activeByDefault&gt;
                  &lt;/activation&gt;
                  &lt;build&gt;
                      &lt;plugins&gt;
                          &lt;plugin&gt;
                              &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
                              &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
                              &lt;configuration&gt;
                                  &lt;stopPort&gt;${jetty.stop.port}&lt;/stopPort&gt;
                                  &lt;stopKey&gt;STOP&lt;/stopKey&gt;
                              &lt;/configuration&gt;
                              &lt;executions&gt;
                                  &lt;execution&gt;
                                      &lt;id&gt;stop-jetty&lt;/id&gt;
                                      &lt;phase&gt;post-integration-test&lt;/phase&gt;
                                      &lt;goals&gt;
                                          &lt;goal&gt;stop&lt;/goal&gt;
                                      &lt;/goals&gt;
                                  &lt;/execution&gt;
                              &lt;/executions&gt;
                          &lt;/plugin&gt;
                      &lt;/plugins&gt;
                  &lt;/build&gt;
              &lt;/profile&gt;
  
  
              &lt;!-- create project profile --&gt;
              &lt;profile&gt;
                  &lt;id&gt;create-project&lt;/id&gt;
                  &lt;activation&gt;
                      &lt;activeByDefault&gt;false&lt;/activeByDefault&gt;
                  &lt;/activation&gt;
                  &lt;properties&gt;
                      &lt;serverUrl&gt;http://localhost:${env.JETTY_PORT}/qcbin&lt;/serverUrl&gt;
                      &lt;saUser&gt;sa&lt;/saUser&gt;
                      &lt;projectUserName&gt;restuser&lt;/projectUserName&gt;
                      &lt;domain&gt;UNITEST&lt;/domain&gt;
                      &lt;project&gt;resttest&lt;/project&gt;
                      &lt;overwrite&gt;true&lt;/overwrite&gt;
                  &lt;/properties&gt;
                  &lt;build&gt;
                      &lt;plugins&gt;
                          &lt;plugin&gt;
                              &lt;groupId&gt;com.apm.maven.plugins.alm&lt;/groupId&gt;
                              &lt;artifactId&gt;rest-create-project&lt;/artifactId&gt;
                              &lt;version&gt;1.0.8.2&lt;/version&gt;
                              &lt;executions&gt;
                                  &lt;execution&gt;
                                      &lt;id&gt;clean-create&lt;/id&gt;
                                      &lt;phase&gt;pre-integration-test&lt;/phase&gt;
                                      &lt;goals&gt;
                                          &lt;goal&gt;create-project&lt;/goal&gt;
                                      &lt;/goals&gt;
                                      &lt;configuration&gt;
                                          &lt;serverUrl&gt;${serverUrl}&lt;/serverUrl&gt;
                                          &lt;saUser&gt;${saUser}&lt;/saUser&gt;
                                          &lt;projectUserName&gt;${projectUserName}&lt;/projectUserName&gt;
                                          &lt;projectUserPassword&gt;${projectUserPassword}&lt;/projectUserPassword&gt;
                                          &lt;domain&gt;${domain}&lt;/domain&gt;
                                          &lt;project&gt;${project}&lt;/project&gt;
                                          &lt;overwrite&gt;${overwrite}&lt;/overwrite&gt;
                                          &lt;extensions&gt;${extensions}&lt;/extensions&gt;
                                      &lt;/configuration&gt;
                                  &lt;/execution&gt;
                              &lt;/executions&gt;
                          &lt;/plugin&gt;
                      &lt;/plugins&gt;
                  &lt;/build&gt;
              &lt;/profile&gt;
  
          &lt;/profiles&gt;
      &lt;/project&gt;
  </code></pre>
  
  <p><strong><em>Child module pom.xml:</em></strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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;parent&gt;
          &lt;groupId&gt;com.apm.platform&lt;/groupId&gt;
          &lt;artifactId&gt;apm-tests&lt;/artifactId&gt;
          &lt;version&gt;12.50.9999-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;artifactId&gt;apm-adapter-tests&lt;/artifactId&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
  
  
      &lt;properties&gt;
          &lt;tests.version&gt;${project.version}&lt;/tests.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
         &lt;dependency&gt;
                        &lt;groupId&gt;com.apm.platform&lt;/groupId&gt;
                        &lt;artifactId&gt;apm-synchronizer-adapter-testing&lt;/artifactId&gt;
                        &lt;version&gt;1.10.9999-SNAPSHOT&lt;/version&gt;
                        &lt;classifier&gt;test-jar-with-dependencies&lt;/classifier&gt;
  
         &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;profiles&gt;
          &lt;!--run integration tests using surefire plugin --&gt;
          &lt;profile&gt;
              &lt;id&gt;itest&lt;/id&gt;
  
              &lt;build&gt;
                  &lt;plugins&gt;
                      &lt;plugin&gt;
  
                          &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                          &lt;version&gt;${surefire.version}&lt;/version&gt;
                          &lt;dependencies&gt;
                              &lt;dependency&gt;
                                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                                  &lt;artifactId&gt;maven-surefire-report-plugin&lt;/artifactId&gt;
                                  &lt;version&gt;${surefire.version}&lt;/version&gt;
                              &lt;/dependency&gt;
                          &lt;/dependencies&gt;
                          &lt;executions&gt;
                              &lt;execution&gt;
                                  &lt;id&gt;integration-test&lt;/id&gt;
                                  &lt;phase&gt;integration-test&lt;/phase&gt;
                                  &lt;goals&gt;
                                      &lt;goal&gt;test&lt;/goal&gt;
                                  &lt;/goals&gt;
                                  &lt;configuration&gt;
                                      &lt;excludedGroups&gt;com.apm.platform.CAPQIntegrationTestCategory&lt;/excludedGroups&gt;
                                      &lt;skipTests&gt;false&lt;/skipTests&gt;
                                      &lt;excludes&gt;
                                        &lt;exclude&gt;junit/**/*.java&lt;/exclude&gt;
                                        &lt;exclude&gt;org/**/*.java&lt;/exclude&gt;
                                      &lt;/excludes&gt;
                                      &lt;argLine&gt;-Xmx1536m&lt;/argLine&gt;
  
                                  &lt;/configuration&gt;
                              &lt;/execution&gt;
                          &lt;/executions&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
              &lt;/build&gt;
          &lt;/profile&gt;
  
          &lt;profile&gt;
              &lt;id&gt;sync-adapter&lt;/id&gt;
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                        &lt;groupId&gt;com.apm.platform&lt;/groupId&gt;
                        &lt;artifactId&gt;apm-synchronizer-adapter-testing&lt;/artifactId&gt;
                        &lt;version&gt;1.10.9999-SNAPSHOT&lt;/version&gt;
                        &lt;classifier&gt;test-jar-with-dependencies&lt;/classifier&gt;
                        &lt;scope&gt;test&lt;/scope&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
              &lt;build&gt;
                  &lt;plugins&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                          &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
                          &lt;executions&gt;
                              &lt;execution&gt;
                                  &lt;!--copies dependent classes from test-jars--&gt;
                                  &lt;id&gt;unpack-tests&lt;/id&gt;
                                  &lt;phase&gt;pre-integration-test&lt;/phase&gt;
                                  &lt;goals&gt;
                                      &lt;goal&gt;unpack&lt;/goal&gt;
                                  &lt;/goals&gt;
                                  &lt;configuration&gt;
                                      &lt;artifactItems&gt;
                                          &lt;artifactItem&gt;
                                              &lt;groupId&gt;com.apm.platform&lt;/groupId&gt;
                                              &lt;artifactId&gt;agm-synchronizer-adapter-testing&lt;/artifactId&gt;
                                              &lt;version&gt;1.10.9999-SNAPSHOT&lt;/version&gt;
                                              &lt;classifier&gt;test-jar-with-dependencies&lt;/classifier&gt;
                                              &lt;outputDirectory&gt;${project.build.testOutputDirectory}&lt;/outputDirectory&gt;
                                          &lt;/artifactItem&gt;
                                      &lt;/artifactItems&gt;
                                  &lt;/configuration&gt;
                              &lt;/execution&gt;
                          &lt;/executions&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
              &lt;/build&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  &lt;/project&gt;
  </code></pre>
  
  <blockquote>
    <p>13:03:13 2015-11-30 13:03:14.422:INFO:oejs.Server:main: Started</p>
    
    <p>@207555ms 13:03:13 [INFO] Started Jetty Server 13:03:13 [INFO] </p>
    
    <p>13:03:13 [INFO] --- maven-surefire-plugin:2.16:test (integration-test)</p>
    
    <p>@ apm-tests --- 13:03:14 [INFO] <strong>No tests to run.</strong> 13:03:14 [INFO] </p>
    
    <p>13:03:14 [INFO] --- jetty-maven-plugin:9.1.3.v20140225:stop</p>
    
    <p>(stop-jetty) @ apm-tests --- 13:03:14 [INFO]  13:03:14 [INFO] ---</p>
    
    <p>maven-source-plugin:2.2.1:jar-no-fork (attach-sources) @ alm-tests ---</p>
    
    <p>13:03:14 2015-11-30</p>
    
    <p>13:03:14.820:INFO:oejs.ServerConnector:ShutdownMonitor: Stopped</p>
    
    <p>ServerConnector@4c8d3b5c{HTTP/1.1}{0.0.0.0:5729} 13:03:14 [INFO] </p>
    
    <p>13:03:14 [INFO] --- maven-source-plugin:2.2.1:test-jar-no-fork</p>
    
    <p>(attach-test-sources) @ alm-tests --- 13:03:14 [INFO]         </p>
    
    <p>13:03:14 [INFO]</p>
    
    <p>--------------- 13:03:14 [INFO] Building agm-synchronizer-adapter-testing</p>
    
    <p>12.50.9999-SNAPSHOT 13:03:14 [INFO] ------------</p>
  </blockquote>