title: Maven not Running Tests Specified in Profile
body: <p>I've got a vary simple profile in my maven pom file to run some integration tests during the normal test phase. Note I do not want to run these tests during the normal integration-test phase because I do not want to build the war and deploy etc. The tests run fine as normal JUnit tests.</p>
  
  <p>So here is my profile:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;profile&gt;
    &lt;id&gt;AdminSeltests&lt;/id&gt;
    &lt;build&gt;
      &lt;plugins&gt;
     &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.12&lt;/version&gt;
  
        &lt;configuration&gt;
            &lt;includes&gt;
              &lt;include&gt;**/*/TestSellerSignupWizard.java&lt;/include&gt;
            &lt;/includes&gt;
        &lt;/configuration&gt;
  
        &lt;executions&gt;
        &lt;execution&gt;
          &lt;id&gt;execution2&lt;/id&gt;
          &lt;phase&gt;test&lt;/phase&gt;
         &lt;/execution&gt;
        &lt;/executions&gt;
      &lt;/plugin&gt; 
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/profile&gt;
  </code></pre>
  
  <p>My test is called:</p>
  
  <pre><code>com.xxxxx.xxx.client.selenium.seller_signup.TestCustomerSignupWizard
  </code></pre>
  
  <p>However when I run the above profile with:</p>
  
  <pre><code>mvn test -P AdminSeltests
  </code></pre>
  
  <p>No tests are run. I have tried the following as the  value(s):</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;include&gt;**/TestSellerSignupWizard.*&lt;/include&gt;
  &lt;include&gt;**/TestSeller*.*&lt;/include&gt;
  &lt;include&gt;**/TestSeller*.java&lt;/include&gt;
  &lt;include&gt;**/*/TestSeller*.java&lt;/include&gt;
  &lt;include&gt;
    com.xxxxx.xxx.client.selenium.seller_signup.TestCustomerSignupWizard.java
  &lt;/include&gt;
  </code></pre>
  
  <p>None of these work.</p>
  
  <p>Any ideas anyone?</p>
  
  <p>Thanks 
  Adam</p>
  
  <p>SOLVED:
  I'm using the <code>maven-surefire-plugin</code> and this has a automatic <code>includes</code> section which includes your normal test stuff. So I made an <code>exclude</code> configuration to exclude the normal unit tests, and then an <code>include</code> section to include a patter of integration test that I want to run</p>
  
  <p>Not sure why it works this way, but it does:</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;excludes&gt;
        &lt;exclude&gt;**/Test*.java&lt;/exclude&gt;
        &lt;exclude&gt;**/*Test.java&lt;/exclude&gt;
        &lt;exclude&gt;**/*TestCase.java&lt;/exclude&gt;
      &lt;/excludes&gt;
      &lt;includes&gt;
        &lt;include&gt;**/ITTestSellerSignupWizard.java&lt;/include&gt;
      &lt;/includes&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Thanks for your help everyone.</p>