Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
822 views
in Technique[技术] by (71.8m points)

Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved

I have install maven in my machine. I have properly set the class-path and maven home folder. Every time I execute mvn clean install, it gives me exception. I have also tried to delete the .m2 folder but the same result.

  • mvn -version output

    Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00)
    Maven home: C:maven-3
    Java version: 1.7.0_45, vendor: Oracle Corporation
    Java home: D:jdk170_45jre
    Default locale: en_US, platform encoding: MS950
    OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
    
  • log for mvn -X clean install

        Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00)
        Maven home: C:maven-3
        Java version: 1.7.0_45, vendor: Oracle Corporation
        Java home: D:jdk170_45jre
        Default locale: en_US, platform encoding: MS950
        OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
        [DEBUG] Created new class realm maven.api
        [DEBUG] Importing foreign packages into class realm maven.api
        [DEBUG]   Imported: javax.enterprise.inject.* < plexus.core
        [DEBUG]   Imported: javax.enterprise.util.* < plexus.core
        [DEBUG]   Imported: javax.inject.* < plexus.core
        [DEBUG]   Imported: org.apache.maven.* < plexus.core
        [DEBUG]   Imported: org.apache.maven.artifact < plexus.core
        [DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
        [DEBUG]   Imported: org.apache.maven.cli < plexus.core
        [DEBUG]   Imported: org.apache.maven.configuration < plexus.core
        [DEBUG]   Imported: org.apache.maven.exception < plexus.core
        [DEBUG]   Imported: org.apache.maven.execution < plexus.core
        [DEBUG]   Imported: org.apache.maven.execution.scope < plexus.core
        [DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
        [DEBUG]   Imported: org.apache.maven.model < plexus.core
        [DEBUG]   Imported: org.apache.maven.monitor < plexus.core
        [DEBUG]   Imported: org.apache.maven.plugin < plexus.core
        [DEBUG]   Imported: org.apache.maven.profiles < plexus.core
        [DEBUG]   Imported: org.apache.maven.project < plexus.core
        [DEBUG]   Imported: org.apache.maven.reporting < plexus.core
        [DEBUG]   Imported: org.apache.maven.repository < plexus.core
        [DEBUG]   Imported: org.apache.maven.rtinfo < plexus.core
        [DEBUG]   Imported: org.apache.maven.settings < plexus.core
        [DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
        [DEBUG]   Imported: org.apache.maven.usability < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
        [DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
        [DEBUG]   Imported: org.codehaus.classworlds < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
        [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.* < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.artifact < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.collection < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.deployment < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.graph < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.impl < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.installation < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.internal.impl < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.metadata < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.repository < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.resolution < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.spi < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.transfer < plexus.core
        [DEBUG]   Imported: org.eclipse.aether.version < plexus.core
        [DEBUG]   Imported: org.slf4j.* < plexus.core
        [DEBUG]   Imported: org.slf4j.spi.* < plexus.core
        [DEBUG] Populating class realm maven.api
        [INFO] Error stacktraces are turned on.
        [DEBUG] Reading global settings from C:maven-3confsettings.xml
        [DEBUG] Reading user settings from C:UsersH1514.m2settings.xml
        [DEBUG] Reading global toolchains from C:maven-3confoolchains.xml
        [DEBUG] Reading user toolchains from C:UsersH1514.m2oolchains.xml
        [DEBUG] Using local repository at C:UsersH1514.m2
    epository
        [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for C:UsersH1514.m2
    epository
        [INFO] Scanning for projects...
        [DEBUG] Extension realms for project camel:camel:jar:0.0.1-SNAPSHOT: (none)
        [DEBUG] Looking up lifecyle mappings for packaging jar from ClassRealm[plexus.core, parent: null]
        [DEBUG] === REACTOR BUILD PLAN ================================================
        [DEBUG] Project: camel:camel:jar:0.0.1-SNAPSHOT
        [DEBUG] Tasks:   [clean, install]
        [DEBUG] Style:   Regular
        [DEBUG] =======================================================================
        [INFO]                                                                         
        [INFO] ------------------------------------------------------------------------
        [INFO] Building camel 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] Using transporter WagonTransporter with priority -1.0 for https://repo.maven.apache.org/maven2
        [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.maven.apache.org/maven2
        Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
    
        [DEBUG] Writing tracking file C:UsersH1514.m2
    epositoryorgapachemavenpluginsmaven-clean-plugin2.5maven-clean-plugin-2.5.pom.lastUpdated
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD FAILURE
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 22.858 s
        [INFO] Finished at: 2015-05-29T14:11:00+08:00
        [INFO] Final Memory: 5M/15M
        [INFO] ------------------------------------------------------------------------
        [ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/23.235.47.215] failed: Connection timed out: connect -> [Help 1]
        org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
            at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:117)
            at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:179)
            at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:298)
            at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:241)
            at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:169)
            at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:155)
            at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:131)
            at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:145)
            at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan(BuilderCommon.java:96)
            at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:109)
            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:128)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
            at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
            at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
            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(Me

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Your debug output indicates that Clean is the first thing that it's trying to run, so I'm guessing it's failing to download any plugins from central.

First off, see if you can download the plugin jar directly in a web browser: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar

If that works then your web browser has connectivity to central but maven doesn't. That suggests to me that your web browser is using a proxy that maven isn't configured to use.

Maven proxy settings are described in depth here. To simplify that a little fill this out (replace the protocol/host/port with the values from your internet settings) and put it in the <settings> tag of your maven settings.xml file:

<proxies>
  <proxy>
    <id>proxy</id>
    <active>true</active>
    <protocol>http</protocol>
    <host>proxy.example.com</host>
    <port>8080</port>
  </proxy>
</proxies>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...