当前位置: 首页 > 知识库问答 >
问题:

未能执行目标org.apache.maven.plugins:maven-clean-plugin:2.4.1

盖弘毅
2023-03-14

我正在做一个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净时,它是有效的。

共有3个答案

程正阳
2023-03-14

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

方法:爪哇。执行可执行文件以占用 jar 文件的项目。解决方案并将任务管理器启用到Java。Exe,再次执行清理可以

卫嘉谊
2023-03-14

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

因此,请确保关闭浏览器中的所有报告文件。然后进行清理。

施俊明
2023-03-14

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

您从命令行以哪个用户身份运行“mvn clean”?

我所说的“文件”是指在清理失败之前列出的jpg文件。

无法清理项目:无法删除/用户/lingxiubo/桌面/chenyl/软注册/目标/软注册/资源/图像/登录/?????? 1011_theme_asia.jpg

使现代化

最后,事实证明其中一个文件名中有一些特殊字符导致了Eclipse的maven打嗝。

 类似资料: