Maven打包异常:Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resource

问题:
Maven工程打包时报错:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources) on project APD-DemoCase-Automation: Cannot create resource output directory: D:\2019Project\APD-DemoCase-Automation\target\classes -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

解决方案:
手动删除工程下自动生成的target目录,或执行命令:mvn clean


Maven打包异常:Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resource_第1张图片
image.png

再执行命令:mvn package
或者,直接执行:mvn clean package

这里需要忽略测试类,不忽略的话在打包时就会自动执行测试用例。
在pom.xml文件中加入以下配置: true


Maven打包异常:Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resource_第2张图片
image.png

或者,使用命令:mvn clean package -Dmaven.test.skip=true

你可能感兴趣的:(Maven打包异常:Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resource)