1.问题描述:
当出现以下
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project film: There are test failures.
此类问题经多多次排查,可以确定是单元测试不通过,maven在构建项目时报错,在pom中添加一下内容,可以使maven在构建项目的时候跳过单元测试错误:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
2.如果在linux运行时网上的静态资源访问不出来
需要在pom里的 <build> 里面加
<resources>
<resource>
<directory>${basedir}/src/main/webapp</directory>
<!--注意此次必须要放在此目录下才能被访问到-->
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/**</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
来源:CSDN
作者:李东要努力
链接:https://blog.csdn.net/weixin_45034355/article/details/104857315