`

maven + jetty配置context path,reload,scanIntervalSeconds

阅读更多
在pom.xml文件中的<plugins>中加入:
<plugin>  
         <groupId>org.mortbay.jetty</groupId>  
         <artifactId>maven-jetty-plugin</artifactId>  
         <version>${jetty.version}</version>
         <configuration>  
             <contextPath>/shiro</contextPath>  
             <connectors>  
                 <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">  
                     <port>8080</port>  
                 </connector>  
             </connectors>  
             <reload>automatic</reload>
             <scanIntervalSeconds>10</scanIntervalSeconds>  
         </configuration>  
</plugin>


使用命令行时 mvn jetty:run -Djetty.reload=automatic -Djetty.scanIntervalSeconds=10

分享到:
评论
2 楼 philipho123 2013-12-30  
Jnerd 写道
你的这个contextPath是eclipse生成的,还是你手动写上去的?如果是eclipse生成的是怎么设的?

手工在项目的pom.xml文件中添加的。如果使用eclipse生成,你可以将pom.xml的视图切换到overview下面看一看。我习惯用手工加,更有利于自己了解其结构。
1 楼 Jnerd 2013-09-26  
你的这个contextPath是eclipse生成的,还是你手动写上去的?如果是eclipse生成的是怎么设的?

相关推荐

Global site tag (gtag.js) - Google Analytics