Java Reference
In-Depth Information
<configuration>
<srcFile>${project.build.directory}/${pom.artifactId}-
${pom.version}.war</srcFile>
<destFile>${project.build.directory}/${pom.artifactId}-
cactified.war</destFile>
<testClasses>
<directory>target/test-classes</directory>
<includes>
<include>**/**Test*.class</include>
</includes>
</testClasses>
<libDependencies>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
</dependency>
</libDependencies>
</configuration>
<executions>
<execution>
<id>cactus-cactifywar</id>
<phase>pre-integration-test</phase>
<goals>
<goal>cactifywar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-— Continue with listing 14.19 here -->
As we mentioned already, all we do is define three plug-ins, one after another in
the correct order. The first one is the cactus.integration.maven2 plug-in B . We
use it for cactification of the WAR file we got from the previous listing. Again, as in
the cactifywar task, we specify srcfile and destfile parameters C . We also spec-
ify which test classes to include D and which libraries to include in the WEB - INF /
lib folder E . In this case, we want only the commons-beanutils, because our tests
use it.
It's important to specify the execution order of the plug-ins. In Maven we specify
the execution order by attaching every plug-in goal to a single phase. For instance, in
the listing we attached our plug-in's cactifywar goal to the pre-integration-test phase
F . This phase, as its name implies, is executed by Maven just before the integration-
test phase (in which we're going to execute our tests). This is perfect, because we want
our package cactified before we execute our tests.
Listing 14.19 displays the second plug-in.
C
D
E
F
Listing 14.19
Continuation of the plug-in declarations from listing 14.18
<!—-We continue from listing 14.18 -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
G
 
 
Search WWH ::




Custom Search