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