Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] (no subject)

Hi,
I use maven to manage my projects and the maven jetty plugin to launch jetty;
My project is oranized as follows:
Parent project

Project A (web app)
Project B (web app) (stubber)

During the pre-integration-test phase I deploy in project A both
project A and B with this configuration:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.4.2.v20110526</version>
<configuration>
<useTestClasspath>true</useTestClasspath>
<webAppConfig>
<contextPath>/integration-api</contextPath>
</webAppConfig>
<contextHandlers>
<contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
<war>${basedir}/../stubber/target/stubber-0.1.0.BUILD-SNAPSHOT.war</war>
<contextPath>/stubber</contextPath>
</contextHandler>
</contextHandlers>
<useTestClasspath>true</useTestClasspath>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>9960</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<stopKey>foo</stopKey>
<stopPort>9911</stopPort>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
Since stubber contains an H2 database that picks up the connection URL
from a database.properties in the stubber module, would like to
replace the property file with something pointing to the project A
base directory, I need this because since the default url points
./stubber, the database file gets saved either in the parent directory
or the project A directory, depending where was the maven command
executed.
Since I would like that the database always gets saved in project A,
I'm playing with resource filtering or maybe even better Property file
substitution like in the example here
http://docs.codehaus.org/display/JETTY/ContextDeployer but I can't
find an example how to set this up with maven jetty plugin (even more,
with custom context loading with multiple contextHandlers). Also,
ideally, I would like to pass the ${basedir} property from the project
A pom in some way.
Any ideas how to solve this?

Thanks,
Srđan


Back to the top