You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by laredotornado-3 <la...@gmail.com> on 2011/08/05 21:54:33 UTC
How to run a task upon execution of a plugin goal?
Hi,
I'm using Maven 3.0.3 with the Jetty plugin. I would like to run some clean
up tasks (possibly through the antigun plugin) when Jetty is shutdown,
either through the jetty:stop call or when I press Ctrl+C after starting up
Jetty via the jetty:run goal. Is this possible, and if so, how?
Below is what I include in my pom.xml surrounding my jetty profile …
<profile>
<id>jetty</id>
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.2.2.v20101205</version>
<configuration>
<webAppConfig>
<contextPath>/my-context-path</contextPath>
<descriptor>target/${project.artifactId}-${project.version}/WEB-INF/web.xml</descriptor>
</webAppConfig>
<jettyConfig>config/jetty7/jetty.xml</jettyConfig>
<scanIntervalSeconds>10</scanIntervalSeconds>
<contextHandlers>
<contextHandler
implementation="org.eclipse.jetty.server.handler.ContextHandler">
<contextPath>/my-context-path-web</contextPath>
<resourceBase>${project.basedir}/target/web</resourceBase>
<handler implementation="org.eclipse.jetty.server.handler.ResourceHandler"/>
</contextHandler>
</contextHandlers>
</configuration>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-rewrite</artifactId>
<version>7.2.2.v20101205</version>
<type>jar</type>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
Thanks for your help, - Dave
--
View this message in context: http://maven.40175.n5.nabble.com/How-to-run-a-task-upon-execution-of-a-plugin-goal-tp4670661p4670661.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