title: Run JUnit tests in Maven without building and copying files
body: <p>I have a large Maven project which has several modules in it. When I want to run a JUnit test from one module I run 'mvn -Dtest=NameOfTest test' in the directory that contains all the modules. When I run this command Maven goes through each module and tries to compile it (though it's already compiled), which involves copying a bunch of files and adds to the total time of the test. It seems that the 'test' command for the Maven surefire plugin executes all the steps up to the test. I was wondering if there is a way to execute only the test step and not bother with all the attempted compilation and copying of files.</p>
  
  <p>Here is some output from before the test starts:</p>
  
  <pre><code>[INFO] 
  [INFO] --- build-helper-maven-plugin:1.5:add-test-source (add-test-source) @ module1 ---
  [INFO] Test Source directory: &lt;directory in module1 with some generated sources&gt; added.
  [INFO] 
  [INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ module1 ---
  [debug] execute contextualize
  [INFO] Copying 108 resources
  [INFO] Copying 1113 resources
  [INFO] Copying 1 resource
  [INFO]
  </code></pre>
  
  <p>It repeats this for each of the other modules. All told it takes a minute or two before it actually starts the test. Does anyone know a way to get the test to run without bothering with all the compilation beforehand? Please let me know if there's any more information I should provide.</p>