64 java eclipse spring maven spring-tool-suite
我使用STS(弹簧工具套件)+ maven插件.
每次当我运行我的应用程序时,maven-clean我都会看到以下错误:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building hhsystem ui 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ui ---
[INFO] Deleting C:\Users\Nikolay_Tkachev\workspace\HHSystem\UI\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.471s
[INFO] Finished at: Mon Oct 21 12:34:33 MSK 2013
[INFO] Final Memory: 2M/90M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project ui: Failed to clean project: Failed to delete C:\Users\Nikolay_Tkachev\workspace\HHSystem\UI\target\org.ow2.util.asm-asm-tree-3.1.jar -> [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
Run Code Online (Sandbox Code Playgroud)
我必须关闭STS并转到C:\Users\Nikolay_Tkachev\workspace\HHSystem\UI\target并删除org.ow2.util.asm-asm-tree-3.1.jar
再次启动STS后,它可以工作,但这很麻烦.
你能帮我解决这个问题吗?
Kalathoki L.的更新
我maven-clean从这个州跑:

我从命令行看到与eclipse插件相同的行为
如果我在STS运行时观看解锁器,我明白了
:
Yub*_*raj 49
在开始清理之前停止服务器.
停止服务器
您可以从"服务器"视图中停止服务器.
要停止服务器:
工具栏中的图标.在Servers视图中,服务器的状态更改为Stopped.如果由于某种原因服务器无法停止,您可以按如下方式终止该过程:
一个.切换到Debug透视图.
湾 在"进程"视图中,选择要停止的服务器进程.
C.单击终止
工具栏中的图标.
注意:终止服务器时,服务器进程将结束,服务器将不会经历正常的停止例程,例如在servlet上调用destroy()方法.
来源: Eclipse帮助
Sco*_*pio 14
您的问题是,在执行mvn clean命令时,STS中的正在运行的进程正在使用位于目标目录中的文件.Maven将无法删除这些文件(因为其他进程仍在访问它们),因此失败并显示该错误.
在运行Maven控制台命令之前,尝试从STS中停止所有进程(测试,服务器,应用程序).注意:如果STS正在清理项目并因此重新编译源,而不是运行进程,则也可能出现此行为.
小智 7
在mvn clean之前,关闭目标文件夹及其打开的文件
小智 6
尝试禁用“项目”->“自动构建”。
正如Scorpio所建议的,正在运行一个进程,该进程在某个位置锁定了文件。
我有一个大型的多模块Maven项目,该项目经常在清理时失败,这可以为我解决。完成后,我会自动重新启用“构建”。
简介:使用a)停止服务器的外部脚本(批处理文件)和b)在运行maven-clean之前解锁.jar文件.
脚步:
了解如何使用antrun插件在Windows中运行外部批处理文件:sblundy对"启动外部进程"的回答.我们叫这个文件unlock_handles.bat
使用pre_clean.bat中的Sysinternals句柄实用程序下载链接来a)停止Tomcat服务器并b)解锁.jar文件.handle -c并且handle -p在这里很有用.
呼!这有点工作,但它可以为您自动完成整个过程,因此您每次都需要自己手动完成!
好的,这是一个粗略的,概念验证版本的unlock_handles.bat供您试用:
REM "Use handle.exe to figure out the process id and handle ids, parse the output, then close the handle (again using handle.exe)"
cd "C:\Users\Nikolay_Tkachev\workspace\HHSystem\UI\target"
"c:/Program Files/Process Explorer/handle.exe" -p java.exe "C:\Users\Nikolay_Tkachev\workspace\HHSystem\UI\target" > handles.txt
@echo "O====== Going to unlock all the below file handles! =======O"
FOR /F "tokens=1-26 delims=: " %a in (handles.txt) DO @echo %h
FOR /F "tokens=1-26 delims=: " %a in (handles.txt) DO handle -p %c -c %f -y
Run Code Online (Sandbox Code Playgroud)
当然,在尝试之前,您必须更改Sysinternals的handle.exe的路径.
| 归档时间: |
|
| 查看次数: |
123052 次 |
| 最近记录: |