title: Conditionally Execute JMeter Maven Plugin
body: <p>I'm trying to figure out how to execute my JMeter performance test plan conditionally.  I want to have my Jenkins CI job execute it, but when developers run <code>mvn clean install</code> I don't want the below plugins to run. Any ideas on how I can modify my pom.xml to conditionally run the below plugins? </p>
  
  <p><strong>Maven POM.xml JMeter Plugins:</strong></p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;com.lazerycode.jmeter&lt;/groupId&gt;
          &lt;artifactId&gt;jmeter-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.8.1&lt;/version&gt;
          &lt;executions&gt;
           &lt;execution&gt;
            &lt;id&gt;jmeter-tests&lt;/id&gt;
            &lt;phase&gt;verify&lt;/phase&gt;
            &lt;goals&gt;
             &lt;goal&gt;jmeter&lt;/goal&gt;
            &lt;/goals&gt;
           &lt;/execution&gt;
          &lt;/executions&gt;
          &lt;configuration&gt;
           &lt;testFilesDirectory&gt;${project.basedir}/src/test/jmeter&lt;/testFilesDirectory&gt;
           &lt;ignoreResultFailures&gt;true&lt;/ignoreResultFailures&gt;
           &lt;testResultsTimestamp&gt;false&lt;/testResultsTimestamp&gt;
          &lt;/configuration&gt;
         &lt;/plugin&gt;
         &lt;plugin&gt;
      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
      &lt;artifactId&gt;xml-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
      &lt;executions&gt;
       &lt;execution&gt;
        &lt;phase&gt;verify&lt;/phase&gt;
        &lt;goals&gt;
         &lt;goal&gt;transform&lt;/goal&gt;
        &lt;/goals&gt;
       &lt;/execution&gt;
      &lt;/executions&gt;
      &lt;configuration&gt;
       &lt;transformationSets&gt;
        &lt;transformationSet&gt;
         &lt;dir&gt;${project.build.directory}/jmeter/results&lt;/dir&gt;
         &lt;stylesheet&gt;${project.basedir}/src/test/resources/jmeter-results-detail-report_21.xsl&lt;/stylesheet&gt;
         &lt;outputDir&gt;${project.build.directory}/jmeter/results&lt;/outputDir&gt;
         &lt;fileMappers&gt;
          &lt;fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper"&gt;
           &lt;pattern&gt;(.*?)\s(.*?)&lt;/pattern&gt;
           &lt;replacement&gt;$1$2&lt;/replacement&gt;
           &lt;replaceAll&gt;true&lt;/replaceAll&gt;
          &lt;/fileMapper&gt;
          &lt;fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper"&gt;
           &lt;targetExtension&gt;.html&lt;/targetExtension&gt;
          &lt;/fileMapper&gt;
         &lt;/fileMappers&gt;
        &lt;/transformationSet&gt;
       &lt;/transformationSets&gt;
      &lt;/configuration&gt;
     &lt;/plugin&gt;
     &lt;plugin&gt;
        &lt;groupId&gt;ch.fortysix&lt;/groupId&gt;
        &lt;artifactId&gt;maven-postman-plugin&lt;/artifactId&gt;
        &lt;version&gt;0.1.2&lt;/version&gt;
        &lt;executions&gt;
         &lt;execution&gt;
          &lt;id&gt;send a mail&lt;/id&gt;
          &lt;phase&gt;install&lt;/phase&gt;
          &lt;goals&gt;
           &lt;goal&gt;send-mail&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;inherited&gt;false&lt;/inherited&gt;
          &lt;configuration&gt;
           &lt;from&gt;admin@test.com&lt;/from&gt;
           &lt;subject&gt;Load Test Results&lt;/subject&gt;
           &lt;failonerror&gt;true&lt;/failonerror&gt;
           &lt;mailhost&gt;relay.apple.com&lt;/mailhost&gt;
           &lt;htmlMessageFile&gt;${project.build.directory}/jmeter/results/LoadTestPlan.html&lt;/htmlMessageFile&gt;
           &lt;receivers&gt;
              &lt;receiver&gt;email@me.com&lt;/receiver&gt;
           &lt;/receivers&gt;
           &lt;fileSets&gt;
              &lt;fileSet&gt;
                  &lt;directory&gt;${project.build.directory}/jmeter/results&lt;/directory&gt;
                  &lt;includes&gt;
                      &lt;include&gt;LoadTestPlan.html&lt;/include&gt;
                  &lt;/includes&gt;
              &lt;/fileSet&gt;
            &lt;/fileSets&gt;
           &lt;/configuration&gt;
         &lt;/execution&gt;
        &lt;/executions&gt;
       &lt;/plugin&gt;
  </code></pre>