对于clean (default-clean) on project wh_web: Failed to clean project: Failed to deleteXXXXX解决方案

1.报错信息如下:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean) on project wh_web: Failed to clean project: Failed to delete D:\wareHouse\wh_web\target -> [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
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :wh_web

2.原因分析

最近项目紧,经常Maven 出现这个问题,参考了很多帖子,关tomcat,Eclipse 服务什么的,其实根本不对,后来细想clean命令其实主要就是清空之前打包的数据文件信息,这个主要真实原因是因为 你的文件正在使用(被占用),所以Maven无法获取删除权限。

3.解决方法

1. 一般web层都是Html 或者jsp文件,很可能你开发时候没有关网页,文件被占用,关闭所有网页和浏览器。

2. 我比较喜欢用nootpad打开多个文件进行参考,也可能被占用,关闭相关文本打开软件。

3.检查其余的,tomcat,啥的,看看还有没有可能占用的,最简单的办法就是关闭所有无关文件,然后再点 clean 就OK.

在这里插入图片描述

已标记关键词 清除标记
相关推荐
执行clean package时候报错项目正常运行 [INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ demo-test --- [INFO] Deleting E:\EclipseMars\e3-manager\demo-test\target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ demo-test --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] Copying 0 resource [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ demo-test --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 2 source files to E:\EclipseMars\e3-manager\demo-test\target\classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 16.689 s [INFO] Finished at: 2018-06-30T16:12:47+08:00 [INFO] Final Memory: 20M/112M [INFO] ------------------------------------------------------------------------ [WARNING] The requested profile "pom.xml" could not be activated because it does not exist. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project demo-test: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? [ERROR] -> [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/MojoFailureException 百度上说的jre我都试过了,我用的是jdk而且是1.8. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project demo-test: Compilation failure说找不到3.1 但是我配置这个jar包换个版本却还是报错找不到3.1这个版本。
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页