maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Hammar <and...@hammar.net>
Subject Re: Maven2: Invoking multi-module build with integration-tests and cargo
Date Wed, 09 Feb 2011 13:28:10 GMT
This question might be better to post to the cargo user list than this
generic Maven list.

Anyways, if you would like to keep the app server running afterwards, I
would separate things into distinct steps, like:
mvn cargo:start - start the server (and possibly deploy)
do what ever you want to do with the running app
mvn cargo:stop - to stop the server

A command line as long as "mvn clean install -pl moduleB -amd
-Prun-appserver-and-keep-running" signals, IMHO, that something to
complicated is being created.

/Anders

On Wed, Feb 9, 2011 at 13:11, Jonas Kilian <jonas.kilian_ext@lpsolutions.com
> wrote:

> I want to
> - build my maven modules top-down using snapshot dependencies among each
> other
> - start my appserver with cargo
> - run the integration-tests and
> - keep the appserver running afterwards.
>
> A simplified project structure might look like this
>
> pom.xml
> |_ moduleA
> |_ moduleB
> |_ moduleC
> |_ appserver
>
> Typically, one uses cargo plugin in the "appserver" project like this:
>
> <plugin>
>        <groupId>org.codehaus.cargo</groupId>
>        <artifactId>cargo-maven2-plugin</artifactId>
>        <executions>
>                <execution>
>                        <id>start-container</id>
>                        <phase>pre-integration-test</phase>
>                        <goals>
>                                <goal>start</goal>
>                                <goal>deploy</goal>
>                        </goals>
>                </execution>
>                <execution>
>                        <id>stop-container</id>
>                        <phase>post-integration-test</phase>
>                        <goals>
>                                <goal>stop</goal>
>                        </goals>
>                </execution>
>        </executions>
>        ...
>
> Let's assume I changed "moduleB" and want to build "moduleB" and all its
> dependencies:
>
> $ mvn clean install -pl moduleB -amd
>
> This will create a reactor like this, taking down the appserver afterwards:
>
> - moduleB
> - moduleC
> - appserver
>
> In order to keep the appserver running, I would have to run the phase
> "integration-test" so that the phase "post-integration-test" will not be
> executed and the appserver keeps running.
> But when I do this in the multi-project build, "install" will not be
> executed on moduleA and moduleB, causing the local repository not to be
> updated, which in turn will not start the appserver with the most up-to-date
> snapshots, right?
>
> I assume I need to move the cargo plugin to a custom profile
> "run-appserver-and-shutdown" and duplicating the plugin to a 2nd one named
> "run-appserver-and-keep-running", invoke one or the other depending on what
> I want:
>
> $ mvn clean install -pl moduleB -amd -Prun-appserver-and-shutdown
> $ mvn clean install -pl moduleB -amd -Prun-appserver-and-keep-running
>
> Is there any simpler and cleaner solution?
>
> Thanks a lot,
> Jonas
>
>
>
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message