You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Vincent Massol <vm...@pivolis.com> on 2006/04/01 09:57:40 UTC

RE: [m2] Using the integration-test phase

Hi Wendy,

I don't know if this is useful to you but here's attached an example POM of
using Cargo and m2.

Hope it helps,
-Vincent

PS: This is described in the m2 book going live soon...

> -----Original Message-----
> From: Wendy Smoak [mailto:wsmoak@gmail.com]
> Sent: mardi 28 mars 2006 01:22
> To: Maven Users List
> Subject: [m2] Using the integration-test phase
> 
> If I have some tests that [will eventually] use the Cargo API to start
> a container, that need to be run after the package phase (so that the
> war file exists) and that I want excluded from the test phase... is
> this (see below) close?
> 
> The only problem with it is that the *ServerTest classes never get
> compiled.  I assume this is because they are excluded from the test
> phase.  Do I also need to configure the compiler plugin to work during
> the integration test phase?
> 
> Then I found this post in which (I think) Vincent is advocating having
> the 'ServerTest' classes in a different module entirely:
> <http://mail-archives.apache.org/mod_mbox/maven-
> users/200405.mbox/%3c027601c43eaa$a7b64800$2502a8c0@vma%3e>
> (If I go that route, what would the <packaging> be for the module that
> only contains in-container tests?)
> 
> A list of references, the complete <profile>, and some output are here:
>    http://wiki.wsmoak.net/cgi-bin/wiki.pl?Cargo
> 
> Advice on whether I'm headed in the right direction would be
> appreciated.  There are a few threads on this in the archives, but
> those developers were using Ant to start the container and I couldn't
> work out how their tests were getting compiled.
> 
>    <profile>
>      ...
>        <build>
>          ...
>              <plugins>
>                  <plugin>
>                     <groupId>org.apache.maven.plugins</groupId>
>                     <artifactId>maven-surefire-plugin</artifactId>
>                     <executions>
>                       <execution>
>                         <id>surefire-it</id>
>                         <phase>integration-test</phase>
>                         <configuration>
>                           <includes>
>                               <include>**/*ServerTest.java</include>
>                           </includes>
>                         </configuration>
>                         <goals>
>                           <goal>test</goal>
>                         </goals>
>                       </execution>
>                     </executions>
>                     <configuration>
>                        <excludes>
>                           <exclude>**/*ServerTest.java</exclude>
>                        </excludes>
>                     </configuration>
>                  </plugin>
>              </plugins>
>        </build>
>   </profile>
> 
> Thanks,
> Wendy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org