I quite unintentionally happened to find the JBoss AS 7 distribution in the JBoss maven repository while looking for something completely unrelated.

My first thought when I found this was that given the size of the distribution (72MB) and the amazing startup times, I can very easily download the entire distribution, unpack it, and run my integration tests (using arquillian) in the unpacked container itself, without affecting to the build times too adversely. This would allow the project build to be self contained in that it doesn’t have to rely on or assume the availability of a remote or local JBoss installation.

The maven artifact information for the AS 7 distribution is:

1
2
3
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-dist</artifactId>
<version>7.0.0.Final</version>

Before you proceed, make sure that you’ve added the JBoss maven repository to your POM or nexus repository. More details on the JBoss maven repository can be found here. Using this information, I can download and unpack the server before the integration tests are to run by including the following in my POM:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>pre-integration-test</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-dist</artifactId>
<version>${jboss.version}</version>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

The unpacked server will be placed in target/jboss-as-7.0.0.Final.