一.背景介绍:最近项目在使用maven命令行运行jetty服务器时出现ClassNotFoundException: javax.interceptor.InvocationContext异常
二.环境列举
spring
springMvc
mybatis
maven
mysql
三.解决办法
更换jetty插件的版本
1 <plugin>
2 <groupId>org.mortbay.jetty</groupId>
3 <artifactId>maven-jetty-plugin</artifactId>
4 <version>6.1.26</version>
5 <configuration>
6 <webApp>target/iris-0.0.1-SNAPSHOT.war</webApp>
7 <connectors>
8 <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
9 <port>8087</port>
10 </connector>
11 </connectors>
12 <stopKey>exit</stopKey>
13 <stopPort>8081</stopPort>
14 <webAppSourceDirectory>src/main/webapp</webAppSourceDirectory>
15 <scanIntervalSeconds>2</scanIntervalSeconds>
16 <contextPath>/test</contextPath>
17 </configuration>
18 </plugin>
注意:此处<version>6.1.26</version>节点如果不进行配置,就会默认使用7.0.pre5。