码迷,mamicode.com
首页 > 其他好文 > 详细

Jetty Maven Plugin配置

时间:2016-08-01 19:03:00      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:

官方文档:http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html#maven-config-https

1,在pom.xml中引入jetty插件

    <build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.3.11.v20160721</version>
                <configuration>
                    <scanIntervalSeconds>10</scanIntervalSeconds>
                    <webApp>
                        <contextPath>/test</contextPath>
                    </webApp>
                </configuration>
            </plugin>
        </plugins>
    </build>

2,运行项目

jetty:run

注意:

Jetty默认扫描目录如下,如果在其它目录需要另外配置

resources in ${project.basedir}/src/main/webapp
classes in ${project.build.outputDirectory}
web.xml in ${project.basedir}/src/main/webapp/WEB-INF/

PS:IDEA中给Java项目添加webapp目录

右键项目,选择如下:

技术分享

然后选择Weg Application,添加成功后需要根据jetty默认要求调整目录结构

技术分享

或者直接在Project Structure中添加

技术分享

技术分享

 

Jetty Maven Plugin配置

标签:

原文地址:http://www.cnblogs.com/sunilsun/p/5726725.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!