Nexus只从中央存储库下载POM,而不是JAR

  • 本文关键字:POM JAR 下载 存储 Nexus nexus
  • 更新时间 :
  • 英文 :


我在Nexus(2.6.2-01版本)上遇到了一个非常奇怪的问题。我曾尝试启用/禁用远程索引,但仍然遇到了同样的问题。我已经运行了maven发布插件,在尝试下载该插件的依赖项时,它失败了,错误为

在nexus 中找不到工件org.codehaus.groovy:groovy-all:jar:1.7.6

我之前在org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.2中也遇到了同样的错误,我不得不使用浏览存储手动删除它,然后再次尝试运行发布插件以使其正确下载工件。

如果我在nexus中的中央repo上浏览Remote,它会显示工件的完整内容,但如果我浏览索引,groovy all 1.7.6的jar就会丢失,如果我对groovy all1.7.6进行一般搜索,这也是一样的。

我的设置xml是按照Nexus的Repository Management一书中的建议进行配置的,即

<mirror>
    <id>nexus</id>
    <mirrorOf>*</mirrorOf>
    <name>Nexus Public Repository Group</name>
    <url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
 <profile>
  <id>nexus</id>
  <!--Enable snapshots for the built in central repo to direct -->
  <!--all requests to nexus via the mirror -->
  <repositories>
    <repository>
      <id>central</id>
      <url>http://central</url>
      <releases><enabled>true</enabled></releases>
      <snapshots><enabled>true</enabled></snapshots>
    </repository>
  </repositories>
 <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <url>http://central</url>
      <releases><enabled>true</enabled></releases>
      <snapshots><enabled>true</enabled></snapshots>
    </pluginRepository>
  </pluginRepositories>
</profile>
<activeProfiles>
    <activeProfile>nexus</activeProfile>
</activeProfiles>

这真的很烦人,因为我希望Nexus从中央下载需要的工件!

感谢

您的本地存储库可能已经缓存了找不到工件的事实。运行一个需要groovy-all的项目构建,并使用强制更新

   mvn clean install -U

这应该下载罐子并通过。

此外,索引和下载的内容完全无关。它只是用于搜索。

我在Nexus 2.8中遇到了相同/类似的问题。Nexus会从中央下载pom,但不会下载jar。再多的过期/删除本地Nexus缓存也无法修复它。我甚至升级到了最新的2.12版本。

为了解决这个问题,我将请求超时从20秒增加到了60秒。以管理员身份登录Nexus。点击左侧菜单中的"服务器",在"HTTP请求设置"下,将请求超时增加到60(或更高)。

希望这对以后的人有所帮助。

最新更新