maven中jetty配置
1.pom.xml<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopKey>foo</stopKey>
<stopPort>9999</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>
其中pre-integration-test和post-integration-test可以让jetty随着maven的命令启动,命令结束而停止。
2.settings.xml
添加 <pluginGroups>
<pluginGroup>org.mortbay.jetty</pluginGroup>
</pluginGroups>
不然可能会出这样的错误 No plugin found for prefix 'jetty' in the current project and in the plu
gin groups available from the repo
sitories [local (D:\apache-maven-3.0\repository), nexus (http://localhost:8081/n
exus/content/groups/snapshot), Nexus (http://localhost:8081/nexus/content/groups
/public)] ->
To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please rea
d the following articles:
http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundF
orPrefixException
页:
[1]