On 3/28/06, Wilfred Springer <[EMAIL PROTECTED]> wrote:
> I would also be interested to hear more about this. Actually, I'm kind
> of surprised that compilation of the tests is excluded as well, since I
> had the impression that compilation is done by the maven-compiler-plugin
> (compiler:testCompile) in the test-compile phase.
Yes, but the "outer" <configuration> block is excluding the
*ServerTest classes from compilation during test-compile, so they just
never get compiled. I tried binding another execution of the compiler
plugin to the integration-test phase, but it still wouldn't compile
the previously-excluded classes.
Any time I start fighting with Maven about conditionally including and
excluding things, I recognize it as a sign that the classes don't
belong in the same source tree.
Retreating and regrouping, I moved the integration tests to a separate
module with packaging type 'pom'. AFAICT, with this packaging type,
nothing happens unless you specifically bind executions to a phase.
(For example, even though there are classes in the usual src/test/java
directory structure, 'mvn test' reports 'no goals needed for
project'.)
So, binding both the compiler and surefire plugins to the
integration-test phase is starting to do what I want. Here's what it
looks like so far. Comments welcome!
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>webapp-it</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Webapp Integration Tests</name>
<url>http://maven.apache.org</url>
<dependencies> ... </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>compiler-it</id>
<phase>integration-test</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>surefire-it</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]