在插件存储库中找不到插件 - 当我的公司Nexus关闭时如何修复问题?

时间:2012-07-28 17:19:04

标签: java maven hadoop nexus

我正在尝试在本地推广Hadoop

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

如上所述 - 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]

当我在控制台上看到日志时,我看到了

[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

由于我公司的nexus已关闭,有什么方法可以解决这个问题并让hadoop构建?

更新

在我的项目pom中添加repository后,它仍然失败

[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]

这是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>

2 个答案:

答案 0 :(得分:6)

如果您可以访问互联网,只需声明一个新的maven存储库(在您的pom或您的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>

此配置将首先尝试从您的存储库下载,然后失败。并且maven将尝试所有已声明的存储库,直到它工作....或者不是:)

实际上,您的内部存储库是一个代理,它缓存远程存储库(mvnrepository)。

答案 1 :(得分:2)

下载依赖项并使用maven install plugin

将它们放入m2存储库中