简体   繁体   English

无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.4.1

[英]Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1

I'm doing a maven project,and my IDE is Eclipse。What I cannot grasp is when I use “clean -X” in Eclipse,it will report the following error: 我正在做一个maven项目,我的IDE是Eclipse。我无法掌握的是当我在Eclipse中使用“clean -X”时,它会报告以下错误:

Apache Maven 3.0.4 (r1232337; 2012-01-17 16:44:56+0800)
Maven home: /usr/share/java/apache-maven-3.0.4
Java version: 1.7.0_05, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: EUC_CN
OS name: "mac os x", version: "10.7.4", arch: "x86_64", family: "mac"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/share/java/apache-maven-3.0.4/conf/settings.xml
[DEBUG] Reading user settings from /Users/lingxiubo/Documents/maven/settings.xml
[DEBUG] Using local repository at /Users/lingxiubo/Documents/maven/repo
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /Users/lingxiubo/Documents/maven/repo
[INFO] Scanning for projects...
[DEBUG] Extension realms for project org.soft:soft-enrol:war:0.0.1-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging war from ClassRealm[plexus.core, parent: null]
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: org.soft:soft-enrol:war:0.0.1-SNAPSHOT
[DEBUG] Tasks:   [clean]
[DEBUG] Style:   Regular
[DEBUG] =======================================================================
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building soft-enrol Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project:       org.soft:soft-enrol:0.0.1-SNAPSHOT
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): []
[DEBUG] Repositories (dependencies): [spring-maven-release (http://maven.springframework.org/release, releases+snapshots), spring-maven-milestone (http://maven.springframework.org/milestone, releases+snapshots), JBoss Repo (https://repository.jboss.org/nexus/content/repositories/releases, releases+snapshots), people.apache.snapshots (http://repository.apache.org/content/groups/snapshots-group/, snapshots), central (http://repo.maven.apache.org/maven2, releases)]
[DEBUG] Repositories (plugins)     : [apache.snapshots (http://repository.apache.org/content/groups/snapshots-group/, snapshots), central (http://repo.maven.apache.org/maven2, releases)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <directory default-value="${project.build.directory}"/>
  <excludeDefaultDirectories default-value="false">${clean.excludeDefaultDirectories}</excludeDefaultDirectories>
  <failOnError default-value="true">${maven.clean.failOnError}</failOnError>
  <followSymLinks default-value="false">${clean.followSymLinks}</followSymLinks>
  <outputDirectory default-value="${project.build.outputDirectory}"/>
  <reportDirectory default-value="${project.reporting.outputDirectory}"/>
  <skip default-value="false">${clean.skip}</skip>
  <testOutputDirectory default-value="${project.build.testOutputDirectory}"/>
  <verbose>${clean.verbose}</verbose>
</configuration>
[DEBUG] =======================================================================
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ soft-enrol ---
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG]   Imported: org.sonatype.aether.transfer < plexus.core
[DEBUG]   Imported: org.apache.maven.exception < plexus.core
[DEBUG]   Imported: org.sonatype.aether.metadata < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG]   Imported: org.sonatype.aether.collection < plexus.core
[DEBUG]   Imported: org.sonatype.aether.version < plexus.core
[DEBUG]   Imported: org.apache.maven.monitor < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG]   Imported: org.apache.maven.profiles < plexus.core
[DEBUG]   Imported: org.sonatype.aether.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
[DEBUG]   Imported: org.apache.maven.execution < plexus.core
[DEBUG]   Imported: org.sonatype.aether.artifact < plexus.core
[DEBUG]   Imported: org.sonatype.aether.spi < plexus.core
[DEBUG]   Imported: org.apache.maven.reporting < plexus.core
[DEBUG]   Imported: org.apache.maven.usability < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG]   Imported: org.sonatype.aether.graph < plexus.core
[DEBUG]   Imported: org.sonatype.aether.* < plexus.core
[DEBUG]   Imported: org.apache.maven.settings < plexus.core
[DEBUG]   Imported: org.codehaus.classworlds < plexus.core
[DEBUG]   Imported: org.sonatype.aether.impl < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
[DEBUG]   Imported: org.sonatype.aether.deployment < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
[DEBUG]   Imported: org.apache.maven.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.cli < plexus.core
[DEBUG]   Imported: org.sonatype.aether.installation < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG]   Imported: org.apache.maven.project < plexus.core
[DEBUG]   Imported: org.apache.maven.rtinfo < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.artifact < plexus.core
[DEBUG]   Imported: org.apache.maven.model < plexus.core
[DEBUG]   Imported: org.apache.maven.* < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG]   Imported: org.sonatype.aether.resolution < plexus.core
[DEBUG]   Imported: org.apache.maven.plugin < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG] Populating class realm maven.api
[DEBUG] org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.6:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:2.0.5:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1
[DEBUG]   Included: org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:2.0.5
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.6
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1, parent: sun.misc.Launcher$AppClassLoader@424b29cf]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean' with basic configurator -->
[DEBUG]   (f) directory = /Users/lingxiubo/Desktop/chenyl/soft-enrol/target
[DEBUG]   (f) excludeDefaultDirectories = false
[DEBUG]   (f) failOnError = true
[DEBUG]   (f) followSymLinks = false
[DEBUG]   (f) outputDirectory = /Users/lingxiubo/Desktop/chenyl/soft-enrol/target/classes
[DEBUG]   (f) reportDirectory = /Users/lingxiubo/Desktop/chenyl/soft-enrol/target/site
[DEBUG]   (f) skip = false
[DEBUG]   (f) testOutputDirectory = /Users/lingxiubo/Desktop/chenyl/soft-enrol/target/test-classes
[DEBUG] -- end configuration --
[INFO] Deleting /Users/lingxiubo/Desktop/chenyl/soft-enrol/target
[INFO] Deleting directory /Users/lingxiubo/Desktop/chenyl/soft-enrol/target/test-classes
[INFO] Deleting dangling symlink /Users/lingxiubo/Desktop/chenyl/soft-enrol/target/soft-enrol/resource/image/login/?????? 1011_theme_asia.jpg
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.332s
[INFO] Finished at: Sat Aug 04 15:10:46 CST 2012
[INFO] Final Memory: 7M/101M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project soft-enrol: Failed to clean project: Failed to delete /Users/lingxiubo/Desktop/chenyl/soft-enrol/target/soft-enrol/resource/image/login/?????? 1011_theme_asia.jpg -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project soft-enrol: Failed to clean project: Failed to delete /Users/lingxiubo/Desktop/chenyl/soft-enrol/target/soft-enrol/resource/image/login/?????? 1011_theme_asia.jpg
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    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:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    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:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to clean project: Failed to delete /Users/lingxiubo/Desktop/chenyl/soft-enrol/target/soft-enrol/resource/image/login/?????? 1011_theme_asia.jpg
    at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:188)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: java.io.IOException: Failed to delete /Users/lingxiubo/Desktop/chenyl/soft-enrol/target/soft-enrol/resource/image/login/?????? 1011_theme_asia.jpg
    at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:227)
    at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:186)
    at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:154)
    at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:154)
    at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:154)
    at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:154)
    at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:154)
    at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:115)
    at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:168)
    ... 21 more
[ERROR] 
[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

But when I use the terminal operation mvn clean , it works. 但是当我使用终端操作mvn clean ,它的工作原理。

It looks like there is a symlink in your project which eclipse cannot delete ( search the above for 'dangling symlink') . 看起来你的项目中有一个符号链接,eclipse无法删除(在上面搜索'悬空符号链接')。 Try deleting the file manually once and also check it's permissions. 尝试手动删除文件并检查其权限。

From command line which user do you run 'mvn clean' as ? 从用户命令行运行'mvn clean'为?

By the 'file' I mean the jpg file listed just before the clean fails. 通过'文件',我的意思是在清理失败之前列出的jpg文件。

Failed to clean project: Failed to delete /Users/lingxiubo/Desktop/chenyl/soft-enrol/target/soft-enrol/resource/image/login/?????? 1011_theme_asia.jpg

Update 更新

Finally, it turned out that there were some special characters in one of the file names which were causing Eclipse' maven to hiccup. 最后,事实证明,其中一个文件名中有一些特殊字符导致Eclipse'maven打嗝。

Some times if any of the html file opened in browser and with noticing that if you do mvn clean.... it is giving same error. 有时如果在浏览器中打开任何html文件并注意到如果你做了mvn clean ....它会给出同样的错误。

So make sure to close all reports files from browsers. 因此,请务必关闭浏览器中的所有报告文件。 and then do clean. 然后干净

cause Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project * *Project: Failed to clean project:project Failed to delete cause无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.4.1:项目清理(default-clean) * *项目:无法清理项目:项目无法删除

method: The Java. 方法:Java。 Exe to take up the project of a jar file. exe接受jar文件的项目。 Solutions and enable the task manager to Java. 解决方案并使任务管理器能够使用Java。 Exe, perform cleanup again can exe,再次执行清理即可

In my own case, I realized I had in use the folder described by such error by another program (aka file explorer, terminal). 在我自己的情况下,我意识到我使用了另一个程序(也就是文件浏览器,终端)这样的错误所描述的文件夹。 Once closed this another program, the project compiled right. 一旦关闭了另一个程序,项目编译正确。

暂无
暂无

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

相关问题 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:2.7:resources - Maven:Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources 无法执行目标org.apache.maven.plugins:maven-compiler-plugin等 - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin AND more 未能执行目标 org.apache.maven.plugins:maven-resources-plugin:2.5:resources - Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources 无法执行目标org.apache.maven.plugins:maven-compiler-plugin:3.1:compile - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 无法执行目标org.apache.maven.plugins:maven-jar-plugin:2.4:jar - Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.4:jar 无法执行目标org.apache.maven.plugins:maven-antrun-plugin - Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin Spring Boot 无法执行目标 org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test - Spring Boot Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1 - org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1 未能执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM