新拉取下来的项目打包,报
Error injecting: org.apache.maven.plugin.surefire.SurefirePlugin
java.lang.TypeNotPresentException: Type org.apache.maven.plugin.surefire.SurefirePlugin not present错误,后续报错信息省略。
解决办法:
在pom.xml文件build标签中加入
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7.1</version>
</plugin>
</plugins>
解决Maven打包报错:Error injecting: org.apache.maven.plugin.surefire.SurefirePlugin

当遇到'Error injecting: org.apache.maven.plugin.surefire.SurefirePlugin'的错误时,问题可能在于缺少maven-surefire-plugin的依赖。解决方案是在pom.xml的build部分添加maven-surefire-plugin的相关配置,例如指定版本为2.7.1。这样可以确保构建过程中正确引入该插件,从而避免打包失败。
279

被折叠的 条评论
为什么被折叠?



