dev@glassfish.java.net

Re: Maven question

From: Amy Roh <Amelia.Roh_at_Sun.COM>
Date: Thu, 29 Oct 2009 21:56:33 -0700

Found my answer - using <phase>pre-integration-test</phase> forces the
executions to happen before tests are executed and can be done to set up
the required environment.

Amy Roh wrote:
> Hi,
>
> I am using maven goal glassfish:runweb as below.
>
> <build>
> <defaultGoal>install</defaultGoal>
> <plugins>
> <plugin>
> <groupId>org.glassfish</groupId>
> <artifactId>maven-glassfish-plugin</artifactId>
> <configuration>
> <goalPrefix>glassfish</goalPrefix>
> <app>target/standalonewar.war</app>
> <port>8080</port>
> <name>test</name>
> </configuration>
> <executions>
> <execution>
> <phase>install</phase>
> <goals>
> <goal>runweb</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
>
> What I would like to do -
> 1. execute the maven goal runweb above to first start embedded web/deploy
> 2. run the test (src/test) to check whether the deploy app is
> accessible, etc.
>
> What happens now - due to maven build lifecycle
> 1. maven performs the test first (and fails because embedded hasn't been
> started nor the app is deployed)
> 2. execute the maven goal
>
> Can a maven expert tell me if such configuration can be done so that
> testing happens after maven execution (i.e. glassfish:runweb)?
>
> Thanks,
> Amy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>