Hi List,
In order to achieve automatic testing of my projects, I use Cargo to
automatically deploy newly generated war files to a Tomcat server.
All the specifics to the automatic testing (depedencies, plugin
configuration, etc) are contained inside of a super pom.
Because I have multitudes of projects, the super pom is quite general, thus
no specific info can be specified, such as exact war names, etc. as this
depends on the project that is being build.
Now, each project that I have specifies the super pom as it's parent, and
until now this was working great.
However, I got a project that consists out of different modules:
1. DAO jar
2. Manager jar
2. Webapp (which includes the DAO and the manager)
Now, to not have to invoke the creation of the DAO, manager and the webapp
manually, I created a parent pom which specifies out of which modules (the
dao, manager and the webapp) the project consists. This works great as well
(Really love Maven).
However, in this parent pom (which is of the type "pom") I also wanted to
include my super pom (with the generic settings for automatic testing).
And this is where the problem lies. The Cargo plugin is complaining that it
cannot create a deployable because the project is of the type "pom". Exact
error:
org.codehaus.cargo.container.ContainerException: Cannot create deployable.
There's no registered deployable for the parameters (container [id =
[default]], deployable type [pom]). Valid types for this deployable are:
- ear
- rar
- ejb
- sar
- file
- war
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0</version>
<configuration>
<wait>false</wait>
<container>
<containerId>tomcat5x</containerId>
<zipUrlInstaller>
<url>
http://172.18.0.78/containers/apache-tomcat-5.5.27.tar.gz</url>
<installDir>${project.build.directory}</installDir>
</zipUrlInstaller>
<output>${project.build.directory}/container.log</output>
<log>${project.build.directory}/cargo.log</log>
<timeout>40000</timeout>
</container>
<configuration>
<home>${project.build.directory}/container</home>
<properties>
<cargo.logging>high</cargo.logging>
<cargo.servlet.port>${env.SERVER_PORT}</cargo.servlet.port>
<cargo.rmi.port>${env.SERVER_SHUTDOWN_PORT}</cargo.rmi.port>
<cargo.jvmargs>"-DXms=128M
-DXmx=128M"</cargo.jvmargs>
</properties>
</configuration>
<deployer>
<type>installed</type>
<deployables>
<deployable>
<pingURL>http://localhost:
${env.SERVER_PORT}/${pom.build.finalName}</pingURL>
<pingTimeout>30000</pingTimeout>
</deployable>
</deployables>
</deployer>
</configuration>
</plugin>
Explicitely specifying the deployable as WAR wouldn't change a thing.
A solution I thought of was including the generic super pom in the pom which
creates the WAR, instead of the parent pom of the project.
However, the problem is that I already have a parent pom specified in the
pom which creates the WAR. And it's not possible to specify two.
I'm kind kinda out of options on this (as I am not an experienced used of
Maven), and I was hoping whether somebody could share some alternative
solutions.
TIA