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

时间:2013-08-27 16:08:17

标签: nexus

我对Nexus(版本2.6.2-01)有一个非常奇怪的问题。我已经尝试启用/禁用远程索引,但我仍遇到同样的问题。我已经运行了maven-release-plugin,在尝试下载此插件的依赖项时,它失败并显示错误

无法找到工件org.codehaus.groovy:groovy-all:jar:1.7.6 in nexus

我以前在org.apache.maven.plugin-tools中遇到了同样的错误:maven-plugin-annotations:jar:3.2我不得不使用Browse Storage手动删除它,然后尝试再次运行release插件它可以正确下载工件。

如果我在nexus中的中央仓库上浏览远程,它会显示工件的完整内容,但是如果我浏览索引,则缺少groovy-all 1.7.6的jar,如果我做一般的话,这是相同的搜索groovy-all 1.7.6。

我的设置xml按照Nexus资料库管理中的建议进行配置,即

<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从中央下载需要的工件,这真的很烦人!

由于

2 个答案:

答案 0 :(得分:3)

您的本地存储库可能已缓存未找到工件的事实。运行需要groovy-all的项目构建并使用

强制更新
   mvn clean install -U

那应该下载jar并传递。

索引也与完全下载的内容无关。它仅用于搜索。

答案 1 :(得分:1)

我在Nexus 2.8中遇到了相同/类似的问题。 Nexus会从中央下载pom,而不是jar。没有过期/删除本地Nexus缓存的数量会修复它。我甚至升级到最新版本2.12。

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

希望这可以帮助有人在路上。

相关问题