maven项目如何使用jetty启动?

1、在pom.xml文件中插入下面的片段

<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>9.3.5.v20151012</version>
            <configuration>
                <httpConnector>
                    <port>8080</port>
                </httpConnector>
                <scanIntervalSeconds>5</scanIntervalSeconds>
                <webAppConfig>
                    <contextPath>/</contextPath>
                </webAppConfig>
            </configuration>
        </plugin>
    </plugins>
</build>

2、在idea中,添加maven启动,输入jetty:run命令。

如果启动,报超时的错误,则使用下面的命令:

jetty:run -Dorg.eclipse.jetty.annotations.maxWait=120

posted @ 2016-02-25 17:42  云中飞鱼  阅读(2055)  评论(0编辑  收藏  举报