gpt4 book ai didi

java - 在插件存储库中找不到插件 - 当我的公司 Nexus 出现故障时如何解决问题?

转载 作者:可可西里 更新时间:2023-11-01 14:18:39 26 4
gpt4 key购买 nike

我正在尝试在本地构建 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>

最佳答案

如果您可以访问互联网,只需声明一个新的 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)。

关于java - 在插件存储库中找不到插件 - 当我的公司 Nexus 出现故障时如何解决问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11703124/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com