You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Enrique Rodriguez <en...@gmail.com> on 2009/04/16 07:29:17 UTC

Success with cargo-maven2-plugin

Hi, wicket-users,

I didn't see any mention in the archives about running multiple Wicket
apps with the 'cargo-maven2-plugin', which was recently released as
1.0 (26-Mar-2009), so I figured I'd drop my POM here in case it helps
anyone.

I have 7 Wicket apps that work together with an 8th "central" Wicket
app.  I use this setup for testing and demo'ing various SSO
technologies as well as testing some REST (restlet) and RSS (rome)
interaction between the 7 apps and the 8th central app.  So, I've been
meaning to see if cargo helps make my life easier.  I've tried various
"hacky" things with the maven-jetty-plugin, but the cargo
configuration is making more sense so far.  This example runs Jetty
embedded and I'll definitely being experimenting with cargo's ability
to deploy to a separate container.

The basic idea is you declare your WAR's as deps and then again in the
plugin as "deployables."  The packaging is 'pom' so this is a separate
Maven 2 module from all my WAR modules.  If it were 'war' packaging it
could sit alongside the maven-jetty-plugin in a Wicket app module and
be used to run that app with other war's.  With 'war' packaging it
also has better defaults, so you'll see more config has to be
specified here.  I needed to set some system props, so I left in how
to do that, too.

This is a cut-n-paste with names changed and simplified.  Other than a
parent POM declaration, this is what I'm currently using to quickly
run multiple Wicket apps with a 'mvn cargo:start'.

<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <artifactId>combined</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>Combined</name>
    <packaging>pom</packaging>
    <description>Combined application.</description>
    <dependencies>
        <dependency>
            <groupId>com.example</groupId>
            <artifactId>app1</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>com.example</groupId>
            <artifactId>app2</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <type>war</type>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <configuration>
                    <container>
                        <containerId>jetty6x</containerId>
                        <type>embedded</type>
                        <systemProperties>
                            <my.example>true</my.example>
                        </systemProperties>
                    </container>
                    <configuration>
                        <type>standalone</type>
                        <deployables>
                            <deployable>
                                <groupId>com.example</groupId>
                                <artifactId>app1</artifactId>
                                <type>war</type>
                                <properties>
                                    <context>app1</context>
                                </properties>
                            </deployable>
                            <deployable>
                                <groupId>com.example</groupId>
                                <artifactId>app2</artifactId>
                                <type>war</type>
                                <properties>
                                    <context>app2</context>
                                </properties>
                            </deployable>
                        </deployables>
                    </configuration>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

HTH,

Enrique

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org