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

时间:2012-08-04 07:29:40

标签: eclipse maven

我正在做一个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

但是当我使用终端操作mvn clean时,它可以工作。

4 个答案:

答案 0 :(得分:12)

看起来你的项目中有一个符号链接,eclipse无法删除(在上面搜索'悬空符号链接')。尝试手动删除文件并检查其权限。

从用户命令行运行'mvn clean'为?

“文件”是指清理失败前列出的jpg文件。

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

<强>更新

最后,结果发现其中一个文件名中有一些特殊字符导致Eclipse'maven打嗝。

答案 1 :(得分:2)

有时候,如果在浏览器中打开任何html文件,并注意到如果你做了mvn clean ....它会给出同样的错误。

因此请务必关闭浏览器中的所有报告文件。然后干净。

答案 2 :(得分:0)

原因 无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.4.1:清理(默认清除)项目 * *项目:无法清理项目:项目无法删除

方法: Java。 exe接受jar文件的项目。 解决方案并使任务管理器能够使用Java。 Exe,再次执行清理可以

答案 3 :(得分:0)

在我自己的情况下,我意识到我正在使用另一个程序(也就是文件资源管理器,终端)中此类错误所描述的文件夹。 一旦关闭了另一个程序,项目就可以正确编译。