如何知道哪些Windows进程在执行"mvn清理"导致失败时持有文件夹?
我怀疑某个未知进程正在保存我的"目标"文件夹,这阻止了我进一步操作
有没有办法找到那个未知的过程?
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-clean-plugin:2.5:clean from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-clean-plugin:2.5, parent: sun.misc.Launcher$AppClassLoader@2d4b1fda]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-clean-plugin:2.5:clean' with basic configurator -->
[DEBUG] (f) directory = C:RafiWorkTASKFrenchSprint2pdm_sonartoolquality-managertarget
[DEBUG] (f) excludeDefaultDirectories = false
[DEBUG] (f) failOnError = true
[DEBUG] (f) followSymLinks = false
[DEBUG] (f) outputDirectory = C:RafiWorkTASKFrenchSprint2pdm_sonartoolquality-managertargetclasses
[DEBUG] (f) reportDirectory = C:RafiWorkTASKFrenchSprint2pdm_sonartoolquality-managertargetsite
[DEBUG] (f) retryOnError = true
[DEBUG] (f) skip = false
[DEBUG] (f) testOutputDirectory = C:RafiWorkTASKFrenchSprint2pdm_sonartoolquality-managertargettest-classes
[DEBUG] -- end configuration --
[INFO] Deleting C:RafiWorkTASKFrenchSprint2pdm_sonartoolquality-managertarget
[INFO] Deleting directory C:RafiWorkTASKFrenchSprint2pdm_sonartoolquality-managertarget
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.290 s
[INFO] Finished at: 2017-08-21T15:16:16+05:30
[INFO] Final Memory: 14M/124M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project quality-manager: Failed to clean project: Failed to delete C:RafiWorkTASKFrenchSprint2pdm_sonartoolquality-managertarget -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project quality-manager: Failed to clean project: Failed to delete C:RafiWorkTASKFrenchSprint2pdm_sonartoolquality-managertarget
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to clean project: Failed to delete C:RafiWorkTASKFrenchSprint2pdm_sonartoolquality-managertarget
at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:215)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.io.IOException: Failed to delete C:RafiWorkTASKFrenchSprint2pdm_sonartoolquality-managertarget
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:249)
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:191)
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:117)
at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:193)
当我让调试器运行或项目在本地 Web 服务器上运行时,我往往会得到这个。有时它会变得有点有趣,即使你认为你已经阻止了它,它也会徘徊。
当这种情况发生时,我通常倾向于去任务管理器并杀死在我的机器上运行的任何 java 进程,它通常会修复它。
UseHandle,来自Mark Russinovitch,Sysinternals(现在Microsoft(: https://learn.microsoft.com/en-us/sysinternals/downloads/handle
这将帮助您找到违规者(通常是您自己的 Java 进程或资源管理器.exe,甚至是您运行 Maven 的 CMD.EXE(。