Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plugin not found in plugin repository - How fix an issue when my company Nexus is down?

I am trying to buld Hadoop locally and when I do

$ mvn  -U clean install -Pdist -Dtar -Ptest-patch

as mentioned - http://wiki.apache.org/hadoop/HowToSetupYourDevelopmentEnvironment

[ERROR] Error resolving version for plugin 'org.apache.maven.plugins:maven-javadoc-plugin' from the repositories [local (/Users/me/.m2/repository), nexus (http://beefy.myorg.local:8081/nexus/content/groups/public)]: Plugin not found in any plugin repository -> [Help 1]

As I see logs on console, I see

[INFO] Apache Hadoop Distribution
[INFO] Apache Hadoop Client
[INFO] Apache Hadoop Mini-Cluster
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Hadoop Main 3.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://beefy.myorg.local:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-javadoc-plugin/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-javadoc-plugin/maven-metadata.xml from/to nexus (http://beefy.myorg.local:8081/nexus/content/groups/public): Error transferring file: Operation timed out

Since nexus in my company is down, is there any way I can resolve this and let hadoop build?

UPDATE

After adding the repository in my project pom, it still fails

[ERROR] Failed to execute goal on project hadoop: Could not resolve dependencies for project groupId:hadoop:jar:master-SNAPSHOT: Failed to collect dependencies for [org.apache.hadoop:hadoop-core:jar:0.20.2 (compile)]: Failed to read artifact descriptor for org.apache.hadoop:hadoop-core:jar:0.20.2: Could not transfer artifact org.apache.hadoop:hadoop-core:pom:0.20.2 from/to nexus (http://beefy.myorg.local:8081/nexus/content/groups/public): Error transferring file: Operation timed out -> [Help 1]

and this is pom.xml

  <repositories>
        <repository>
            <id>mvnrepository</id>
            <url>http://mvnrepository.com/artifact/</url>
        </repository>

    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-core</artifactId>
            <version>0.20.2</version>
        </dependency>
    </dependencies>
like image 307
daydreamer Avatar asked Jul 28 '12 17:07

daydreamer


2 Answers

If you have access to internet, simply declare a new maven repository (in you pom, or in you settings.xml) :

  <repositories>
    <repository>
      <id>your-internal-repo</id>
      <url>http://beefy.myorg.local:8081/nexus/content/</url>
    </repository>

    <repository>
      <id>mvnrepository</id>
      <url>http://mvnrepository.com/artifact/</url>
    </repository>
  </repositories>

This configuration will first try to download from you repository, then fail. And maven will try all declared repositories, until it works .... or not :)

Indeed, your internal repository is a proxy, that caches the distant one (mvnrepository).

like image 76
Jean-Rémy Revy Avatar answered Oct 23 '22 18:10

Jean-Rémy Revy


Download the dependencies and place them in your m2 repository using the maven install plugin

like image 45
Steven Fines Avatar answered Oct 23 '22 18:10

Steven Fines