Plugin not found in plugin repository – How do I fix the problem when my company Nexus fails?
I’m trying to build Hadoop
locally and when
$ mvn -U clean install -Pdist -Dtar -Ptest-patch
As mentioned earlier – 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 saw the
logs on the console, I saw them
[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 my company’s Nexus
is down, is there any way to fix this and let Hadoop build?
Update
After adding the repository
to 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]
This is the 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>
Solution
If you have internet access, simply declare a new Maven repository (in your pom or your settings.xml
):
<pre class=”lang-xml prettyprint-override”> <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 attempt to download from your repository and then fail. And Maven will try all declared repositories until it works…. or not working 🙂
In effect, your internal repository is a proxy that caches remote repositories (mvnrepositories).