首页 > 技术文章 > maven jetty 配置

chyg 2016-03-29 09:56 原文

对于jdk8增加如下配置:

<plugin>
               <groupId>org.eclipse.jetty</groupId>
               <artifactId>jetty-maven-plugin</artifactId>
               <version>9.3.0.M2</version>
               <configuration>
                   <scanIntervalSeconds>5</scanIntervalSeconds>
                   <webApp>
                       <contextPath>/test</contextPath>
                   </webApp>
                </configuration>
             </plugin>

jdk8因为版本问题可能在jetty启动时出现 java.lang.ArrayIndexOutOfBoundsException异常,可使用上面配置解决。

jdk8以下版本增加

<plugin>
               <groupId>org.mortbay.jetty</groupId>
               <artifactId>jetty-maven-plugin</artifactId>
               <version>8.1.16.v20140903</version>
               <configuration>
                   <scanIntervalSeconds>5</scanIntervalSeconds>
                   <webApp>
                       <contextPath>/test</contextPath>
                   </webApp>
                </configuration>
             </plugin>

 启动 jetty:run

推荐阅读