简体   繁体   English

如何解决“无法在项目上执行目标 org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean)”?

[英]How to solve "Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project"?

I am beginner in Maven.我是 Maven 的初学者。 When I click clean & Build to rebuild my project in netbeans, it throws an error当我单击clean & Build在 netbeans 中重建我的项目时,它会引发错误

Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project xxxx-web: Failed to clean project: Failed to delete D:\\Gps2.x\\xxxx-web\\target\\xxxx-web-2.11-SNAPSHOT\\WEB-INF\\lib\\validation-api-1.0.0.GA.jar -> [Help 1] To see the full stack trace of the errors, re-run Maven with the -e switch.无法在项目 xxxx-web 上执行目标 org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean): Failed to clean project: Failed to delete D:\\Gps2.x\\xxxx -web\\target\\xxxx-web-2.11-SNAPSHOT\\WEB-INF\\lib\\validation-api-1.0.0.GA.jar -> [Help 1] 要查看错误的完整堆栈跟踪,请重新运行 Maven使用 -e 开关。 Re-run Maven using the -X switch to enable full debug logging.使用 -X 开关重新运行 Maven 以启用完整的调试日志记录。

Or how to build a war file using maven package?或者如何使用 maven 包构建一个 war 文件?

This usually happens in Windows environments when the target folder is "locked".当目标文件夹被“锁定”时,这通常发生在 Windows 环境中。 Eg when you are running your web application (looks like you do) and want to perform a mvn clean .例如,当您运行 Web 应用程序(看起来像您这样做)并想要执行mvn clean The application server/servlet engine locks the files so that mvn clean cannot delete the files because they are locked.应用程序服务器/servlet 引擎锁定文件,以便mvn clean无法删除文件,因为它们已被锁定。 Try to run this command when the web application is not running.尝试在 Web 应用程序未运行时运行此命令。

Edit: This also may happen if you have the target folder open in explorer or editing a text file from target folder, etc.编辑:如果您在资源管理器中打开目标文件夹或编辑目标文件夹中的文本文件等,也可能发生这种情况。

在 Glassfish 服务器的情况下,您只需停止服务器并在运行项目后进行清理和构建,它肯定会工作。确认

If you are using windows system, close all applications (eg file explorer, any file opened in eg notepad which is part of the "target" folder etc.).如果您使用的是 windows 系统,请关闭所有应用程序(例如文件资源管理器、在记事本中打开的任何文件,这些文件是“目标”文件夹的一部分等)。 Basically, Maven is trying to Delete the file but as it is "locked" by some other application, Maven can't access it and hence can't delete it.基本上,Maven 试图删除该文件,但由于它被其他应用程序“锁定”,Maven 无法访问它,因此无法删除它。

Clean the project once and rebuild it.清理一次项目并重建它。 If it is not working just kill the java process and restart the studio如果它不起作用,只需杀死java进程并重新启动工作室

系统重新启动对我有用。请尝试。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Maven - 未能执行目标 org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean - Maven - Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean 无法在项目 spring-boot-keycloak 上执行目标 org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean) - Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean) on project spring-boot-keycloak 无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean - Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean 运行Maven项目的多个“实例”-无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean - Running multiple 'instances' of maven project - Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean 如何修复Maven异常:[错误]无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.6.1:clean - How to fix maven exception : [ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.6.1:clean Maven 无法执行目标 org.apache.maven.plugins:maven-clean-plugin:2.5:clean 无法删除 access_log - Maven Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean Failed to delete access_log Maven 全新安装:无法执行目标 org.apache.maven.plugins:maven-resources-plugin:3.20。 - Maven clean install: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources Maven:插件 org.apache.maven.plugins:maven-clean-plugin:2.5 或其依赖项之一无法解析 - Maven : Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved 无法执行目标org.apache.maven.plugins:maven-compiler-plugin:3.5.1:在项目上编译(default-compile) - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project 无法在项目上执行目标org.apache.maven.plugins:maven-compiler-plugin:3.3:compile(default-compile) - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM