You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by ZsJoska <zs...@gmail.com> on 2009/08/30 22:21:21 UTC
Re: dependency to run jetty on a dependent project
With the help of Darren we solved the above problem quite elegantly:
To the generate-sources phase of the web service client we could bind the
following executions:
- a dependency-plugin call to copy to the target directory the war file
produced by the web service project
- jetty:start goal to start the jetty instance with the copied war file
- a wsimport goal to generate the artifacts
They are executed in the enumerated order so it is just fine. somwhere in
the post-integration-test we can close the jetty instance
The relevant part looks like:
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>prepare-myProject-ws</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>myProject-ws</artifactId>
<version>${project.version}</version>
<type>war</type>
<outputDirectory>${project.build.directory}</outputDirectory>
<destFileName>myProject-ws.war</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.16</version>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
<stopKey>foo</stopKey>
<stopPort>9999</stopPort>
<webApp>${project.build.directory}/myProject-ws.war</webApp>
<contextPath>/myProject-ws</contextPath>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>generate-sources</phase>
<goals>
<goal>deploy-war</goal>
</goals>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlUrls>
<wsdlUrl>http://localhost:8080/myProject-ws/ws/AuthService?wsdl</wsdlUrl>
<wsdlUrl>http://localhost:8080/myProject-ws/ws/UserService?wsdl</wsdlUrl>
</wsdlUrls>
<packageName>org.myProject</packageName>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
--
View this message in context: http://www.nabble.com/dependency-to-run-jetty-on-a-dependent-project-tp23252831p25215374.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org