How to set up embedded WildFly server on the fly for testing with Maven <p>I have a question about how to set up an embedded Wildfly 10 server on the fly for integration testing.</p> <pre><code>&lt;!-- Loading Wildfly 10 on the fly and copy it into the target folder. --&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;unpack&lt;/id&gt; &lt;phase&gt;process-test-classes&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;unpack&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;artifactItems&gt; &lt;artifactItem&gt; &lt;groupId&gt;org.wildfly&lt;/groupId&gt; &lt;artifactId&gt;wildfly-dist&lt;/artifactId&gt; &lt;version&gt;10.0.0.Final&lt;/version&gt; &lt;type&gt;zip&lt;/type&gt; &lt;overWrite&gt;false&lt;/overWrite&gt; &lt;outputDirectory&gt;target&lt;/outputDirectory&gt; &lt;/artifactItem&gt; &lt;/artifactItems&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.wildfly.plugins&lt;/groupId&gt; &lt;artifactId&gt;wildfly-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.1.0.Alpha1&lt;/version&gt; &lt;configuration&gt; &lt;jbossHome&gt;target/wildfly-10.0.0.Final&lt;/jbossHome&gt; &lt;hostname&gt;127.0.0.1&lt;/hostname&gt; &lt;!-- &lt;port&gt;9990&lt;/port&gt; --&gt; &lt;filename&gt;${project.build.finalName}.war&lt;/filename&gt; &lt;java-opts&gt; &lt;java-opt&gt;-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005&lt;/java-opt&gt; &lt;/java-opts&gt; &lt;commands&gt; &lt;command&gt;/subsystem=logging/file-handler=debug:add(level=DEBUG,autoflush=true,file={"relative-to"=&gt;"jboss.server.log.dir", "path"=&gt;"debug.log"})&lt;/command&gt; &lt;command&gt;/subsystem=logging/logger=org.jboss.as:add(level=DEBUG,handlers=[debug])&lt;/command&gt; &lt;/commands&gt; &lt;/configuration&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.slf4j&lt;/groupId&gt; &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt; &lt;version&gt;1.6.4&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;deploy&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;execution&gt; &lt;id&gt;start-wildfly&lt;/id&gt; &lt;phase&gt;test-compile&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;run&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;execution&gt; &lt;id&gt;shutdown-wildfly&lt;/id&gt; &lt;phase&gt;test&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;shutdown&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre> <p>First Maven download the server on the fly, saves it to the target folder. Later I want to copy a new standalone.xml, start the server, run the integration test and stop the server.</p> <p>Until now I can't see that I have started the server.</p> <pre><code>------------------------------------------------------- T E S T S ------------------------------------------------------- Running com.example.FunctionalTest Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.071 sec &lt;&lt;&lt; FAILURE! - in com.example.FunctionalTest basicPingTest(com.example.FunctionalTest) Time elapsed: 0.07 sec &lt;&lt;&lt; ERROR! java.net.ConnectException: Connection refused at com.example.FunctionalTest.basicPingTest(FunctionalTest.java:39) Results : Tests in error: FunctionalTest.basicPingTest:39 » Connect Connection refused Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 </code></pre> <p>Does anybody knows how to set up a Maven for start and stop a embedded Wildfly server, start the test cases and hopefully see some logging?</p>