title: How to make maven-surefire-plugin work with TestNG in Eclipse
body: <p>I cannot make these two work together in eclipse</p>
  
  <p>I can set up surefire plugin like this </p>
  
  <pre><code>&lt;suiteXmlFiles&gt;
          &lt;suiteXmlFile&gt;${basedir}/src/test/resources/testng.xml&lt;/suiteXmlFile&gt;
      &lt;/suiteXmlFiles&gt;
      &lt;testResources&gt;
          &lt;testResource&gt;
              &lt;directory&gt;${project.basedir}/src/test/java&lt;/directory&gt;
              &lt;includes&gt;
                  &lt;include&gt;**/*.*&lt;/include&gt;
              &lt;/includes&gt;
          &lt;/testResource&gt;
          &lt;testResource&gt;
              &lt;directory&gt;${project.basedir}/src/test/resources&lt;/directory&gt;
              &lt;includes&gt;
                  &lt;include&gt;**/*&lt;/include&gt;
              &lt;/includes&gt;
          &lt;/testResource&gt;
      &lt;/testResources&gt;
  </code></pre>
  
  <p>and run <code>$mvn test</code> and all resources are compiled and moved into <code>/target/test-classes</code>, which works fine.</p>
  
  <p>But if I run <code>$mvn clean</code> and then use the TestNG view to run some tests, there is nothing compiled in <code>/target/test-classes</code>, so that I either have to run test phase before that, or somehow employ <code>maven-compiler-plugin:testCompile</code> goal to compile test resources ...</p>
  
  <p>but <code>maven-compiler-plugin:2.3.2:testCompile</code> isn't setup like surefire plugin via the <code>testResources</code> configuration. It just compiles test source code into test-classes</p>
  
  <p>What should I do to make testNG execute as if I run surefire plugin ? I somehow need the effect that results from <code>&lt;testResources&gt;</code></p>