title: Integration tests, multiple containers, multiple API implementations and Maven. Any tips?
body: <p>How would you go about configuring the following in Maven?  Assume I have 4 modules:</p>
  
  <ul>
  <li>data-access-api</li>
  <li>data-access-impl-derby</li>
  <li>data-access-impl-postgresql</li>
  <li>data-access-integration-tests</li>
  </ul>
  
  <p>Assume I want to be able to test against two containers:</p>
  
  <ul>
  <li>arquillian-jbossas-ebedded-6</li>
  <li>arquillian-glassfish-embedded-3.1</li>
  </ul>
  
  <p>To run my integration tests, I need the 'data-access-api' module and <strong>exactly one</strong> of the implementations.  I also want to test against <strong>exactly one</strong> of the containers.  I can think of a few ways of making it work, but they all have drawbacks and I don't even know if Maven supports some of them.</p>
  
  <p>I found the following suggestion to add the concept of profile groups to Maven, but, as far as I can tell, nothing similar has ever been added:</p>
  
  <p><a href="http://docs.codehaus.org/display/MAVENUSER/Improvements+to+Profile+Activation+Deactivation" rel="nofollow">http://docs.codehaus.org/display/MAVENUSER/Improvements+to+Profile+Activation+Deactivation</a></p>
  
  <p>The concept of having a group of mutually exclusive profiles would work, but could get unmanageable fairly quickly.  Imagine 3 implementations and 3 containers.  There would be 9 possible profile configurations even though I may only be interested in testing 3 or 4 of the possible combinations.</p>
  
  <p>Another solution I can think of is to create one integration module for each scenario that needs to be tested.  For example (verbose name to clarify what I mean):</p>
  
  <ul>
  <li>integration-arquillian-glassfish-embedded-data-access-postgresql</li>
  </ul>
  
  <p>However, I can't figure out a way to do that without duplicating my integration tests.  My data-access-integration-tests module has <strong>only</strong> integration tests.  I use CDI for dependency injection and the tests run against the API.  I can run the same set of tests against each implementation.  It's just a matter of packaging <strong>exactly one</strong> implementation with the API.</p>
  
  <p>I'm using Maven 2 for now.</p>