首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

maven中jetty配备

2012-12-19 
maven中jetty配置1.pom.xmlplugingroupIdorg.mortbay.jetty/groupIdartifactIdmaven-jetty-plugin

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>

不然可能会出这样的错误
[ERROR] No plugin found for prefix 'jetty' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (D:\apache-maven-3.0\repository), nexus (http://localhost:8081/nexus/content/groups/snapshot), Nexus (http://localhost:8081/nexus/content/groups/public)] -> [Help 1][ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR][ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

热点排行