title: How can I force maven to use my mock version of dependencies during the test phase
body: <p>so I have a Java application with a that accesses some web services.  I want to mock out the appropriate classes so I can just use a few hard coded request/responses and I want maven to seamlessly use them during the tests and ignore them during the final build.</p>
  
  <p>I want maven2 to:</p>
  
  <p>1)compile my mock classes<br>
  2)compile the main classes that depend on the mocked code<br>
  3)run tests<br>
  4)recompile any main classes with the real dependencies, not my mocks<br>
  5)finish up the maven install  </p>
  
  <p>Ideally I want to just name my mock classes the same as my main class and just keep them in src/test/mocks or something.  I'm kind of new to maven and so far it looks like maven will only compile the src/main and then src/test but I'm hoping I can have my way.  Any ideas?</p>