最近项目组升级java8,HW公司不允许使用破解版的IDEA,无奈之下只得去使用社区版IDEA,社区版的tomcat插件只能支持tomcat7,不支持tomcat8.5(java8),解决思路是使用jetty9 maven插件代替,解决方案如下:
1.在pom文件增加以下插件配置:
<!--@see https://www.eclipse.org/jetty/documentation/9.3.x/jetty-maven-plugin.html-->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.8.v20160314</version>
<configuration>
<scanIntervalSeconds>5</scanIntervalSeconds>
<webApp>
<contextPath>/myApp</contextPath>
</webApp>
</configuration>
</plugin>
2.在实际项目中遇到java.lang.Exception: Timeout scanning annotations的问题,修改启动命令
jetty:run -f pom.xml
-->
jetty:run -Dorg.eclipse.jetty.annotations.maxWait=999 -f pom.xml
3.使用IDEA配置maven打包命令
package -f pom.xml
-->
clean package -f pom.xml -D maven.test.skip=true -U -P minify