IDEA使用maven配置内置的Tomcat8,pom.xml文件的配置如下:
亲测有效,欢迎留言
第一步在build中加入如下配置:
<plugins> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat8-maven-plugin</artifactId> <version>3.0-r1655215</version> <configuration> <!-- 通过maven tomcat8:run运行项目时,访问项目的端口号 --> <port>8080</port> <!--设置编码--> <uriEncoding>UTF-8</uriEncoding> <!-- 项目访问路径 本例:localhost:9090, 如果配置的aa, 则访问路径为localhost:9090/aa--> <path>/car-repair</path> </configuration> </plugin> <plugin> <!--配置jdk版本--> <groupId>org.apache.maven.plugi