开发者

Maven woes: maven-clean-plugin not found in repository

Sigh.

Using maven 2.2.1, and suddenly it can't resolve the maven-clean-plugin. And really, how insane is it that a build tool requires a plugin for "clean"?

I tried syncing up my .m2 directory from another machine that works just fine, and I get the same results.

taproot:~/$ mvn clean package -DskipTests
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building CRM Webapp
[INFO]    task-segment: [clean, package]
[INFO] ------------------------------------------------------------------------
Downloading: http://download.java.net/maven/2/org/apache/maven/plugins/maven-clean-plugin/2.2/maven-clean-plugin-2.2.pom
[INFO] Unable to find resource 'org.apache.maven.plugins:maven-clean-plugin:pom:2.2' in repository maven.java.net (http://download.java.net/maven/2)
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.2/maven-clean-plugin-2.2.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-clean-plugin:pom:2.2' from repository central (http://repo1.maven.org/maven2): Specified destination directory cannot be created: /Users/armhold/.m2/repository/org/apache/maven/plugins/maven-clean-plugin/2.2
Downloading: http://repository.jboss.org/nexus/content/groups/public-jboss//org/apache/maven/plugins/maven-clean-plugin/2.2/maven-cl开发者_JS百科ean-plugin-2.2.pom
[INFO] Unable to find resource 'org.apache.maven.plugins:maven-clean-plugin:pom:2.2' in repository public jboss (http://repository.jboss.org/nexus/content/groups/public-jboss/)
Downloading: https://repository.jboss.org/nexus/content/repositories/releases//org/apache/maven/plugins/maven-clean-plugin/2.2/maven-clean-plugin-2.2.pom
[INFO] Unable to find resource 'org.apache.maven.plugins:maven-clean-plugin:pom:2.2' in repository jboss-my-rel (https://repository.jboss.org/nexus/content/repositories/releases/)
Downloading: http://repository.jboss.org/maven2//org/apache/maven/plugins/maven-clean-plugin/2.2/maven-clean-plugin-2.2.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-clean-plugin:pom:2.2' from repository JBOSS (http://repository.jboss.org/maven2/): Specified destination directory cannot be created: /Users/armhold/.m2/repository/org/apache/maven/plugins/maven-clean-plugin/2.2
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.2/maven-clean-plugin-2.2.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-clean-plugin:pom:2.2' from repository central (http://repo1.maven.org/maven2): Specified destination directory cannot be created: /Users/armhold/.m2/repository/org/apache/maven/plugins/maven-clean-plugin/2.2
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org.apache.maven.plugins:maven-clean-plugin

Reason: POM 'org.apache.maven.plugins:maven-clean-plugin' not found in repository: Unable to download the artifact from any repository

  org.apache.maven.plugins:maven-clean-plugin:pom:2.2

from the specified remote repositories:
  jboss-my-rel (https://repository.jboss.org/nexus/content/repositories/releases/),
  central (http://repo1.maven.org/maven2),
  maven.java.net (http://download.java.net/maven/2),
  JBOSS (http://repository.jboss.org/maven2/),
  public jboss (http://repository.jboss.org/nexus/content/groups/public-jboss/)

 for project org.apache.maven.plugins:maven-clean-plugin

My pom looks like this:

<repositories>
    <repository>
        <id>public jboss</id>
        <url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
    </repository>

    <repository>
        <id>jboss-my-rel</id>
        <url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
    </repository>

    <repository>
        <id>JBOSS</id>
        <name>JBoss Repository</name>
        <url>http://repository.jboss.org/maven2/</url>
    </repository>

</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>maven.java.net</id>
        <name>Java.net Maven2 Repository</name>
        <url>http://download.java.net/maven/2</url>
    </pluginRepository>
</pluginRepositories>


if you carefully read your error, you can find the answer there:

 Specified destination directory cannot be created:
 /Users/armhold/.m2/repository/org/apache/maven/plugins/maven-clean-plugin/2.2

you dont have write access to that directory (or the user running maven process doesn't)


Also I faced the similar issue. But I found that was the proxy setting, which are used for our intranet, I did not put in Setting.xml. After putting it, it was boom boom...

    <proxy>
        <id>ABC</id>
        <active>true</active>
        <protocol>http</protocol>
        <username>USER</username>
        <password>Password</password>
        <port>8080</port>
        <host>XXX.net</host>
        <nonProxyHosts>local.net,some.host.com</nonProxyHosts>
    </proxy>


My guess would be that you have a config or network problem that is stopping maven from getting to the net.


I removed the .m2/ directory tree. I then did a mvn clean on my project and it downloaded everything again.


Removing .m2 folder is one option. You can also update your maven version to 3.x so it can resolve your maven plugins.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜