wildfly里面是不能容忍,tomcat,因此需要在Pom文件中加入以下配置:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<!-- 只在test测试里面运行 -->
<scope>test</scope>
</dependency>
<!-- war 插件来定义打包以后的 war 包名称 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warName>ROOT</warName>
<packagingExcludes>
WEB-INF/lib/tomcat-embed-*.jar,
WEB-INF/lib/spring-boot-starter-tomcat-*.jar
</packagingExcludes>
</configuration>
</plugin>
这两个配置完,就可以不用手动删除jar包了