title: How do I setup arquillian to test a maven war project by deploying the entire war to WildFly embedded?
body: <p>I 'd like to do macro (not micro!) black box testing of my war on an embedded WildFly instance.</p>
  
  <p>My maven project looks like this</p>
  
  <pre><code>&lt;project&gt;
    ...
    &lt;packaging&gt;war&lt;/packaging&gt;
  
    &lt;!-- Lots of classes in src/main/webapp and files in src/main/webapp --&gt;
    &lt;dependencies&gt;
      &lt;!-- Lots of compile/runtime dependencies that change very frequently --&gt;
      &lt;!-- Lots of test dependencies that change very frequently --&gt;
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>My arquillian tests need to fulfill the following requirements:</p>
  
  <ul>
  <li><strong>Deploy the entire war</strong> to the app server in the tests. This includes all production classes, all runtime dependencies and all <code>src/main/webapp</code> files. From a maintenance perspective it's impossible to do micro deployments because class dependencies and jar dependencies change very frequently. So we cannot enumerate anything in the ShrinkWrap deployment.</li>
  <li><strong>Don't hardcode anything</strong> in the test or arquillian.xml <strong>that is already known by the maven <code>pom.xml</code></strong>. This includes version strings, dependency lists, package or class lists, app server installation directories, etc.</li>
  <li><strong>Don't use more than 1 maven module</strong>. My tests to test my war belong in the test folder of the same maven module that produces the war.</li>
  <li>Users that checkout my code need to be able so simply run the tests:
  
  <ul>
  <li><strong>Tests needs to run from IntelliJ</strong> after simply opening the <code>pom.xml</code> with IntelliJ.</li>
  <li>Use WildFly embedded container, so nothing needs to be installed first, no process needs to be run first and definitely <strong>no <code>JBOSS_HOME</code> environment variable needs to be set</strong> first.</li>
  </ul></li>
  <li>I am only interested in black box testing, so all my tests can <em>run as client</em>.</li>
  </ul>
  
  <p>In theory, this is all possible with Arquillian's Maven resolver,  embedded containers, <code>@RunAsClient</code>, maven failsafe plugin, some <code>arquillian.xml</code> magic and a lot of maven magic. But in practice, I cannot get that stuff to work together, nor do I find any documentation that covers this scenario decently, so I am hoping someone can clearly show how they can work together.</p>