gpt4 book ai didi

java - 为什么 Jenkins 不下载我的最新快照?

转载 作者:搜寻专家 更新时间:2023-10-31 20:14:13 25 4
gpt4 key购买 nike

我有一个 Maven 3 项目的 Jenkins 构建作业。该项目具有 SNAPSHOT 依赖项。构建失败,因为 Maven 找不到部署到 Intranet Sonatype Nexus Repository 的 SNAPSHOT Artifact 。 SNAPSHOT 存储库是“public”组的一部分,它是 <mirrorOf>*</mirrorOf> 的镜像 URL。 .
Jenkins 配置为在工作区本地创建一个本地 Maven 存储库(每个作业一个存储库)。
所有其他非快照依赖项都已解决并下载良好。没有 SNAPSHOT 依赖项的项目的其他作业也已成功构建。到目前为止我尝试过的事情(没有成功):

  • Nexus 缓存过期
  • 检查了本地存储库(在作业目录中)- 没有 Artifact 目录
  • 在作业配置中将“Build -> Goals and options”设置为“-U clean install”
  • 等一小时

我的设置:
Windows 服务器 2003
Java 1.6.0_31
Jenkins 1.480
maven 3.0.3

最佳答案

这可能是我也发现的“陷阱”,从 Nexus 下载快照修订版。

Nexus book 中提供了解决方案,但没有完全解释:

<settings>
<mirrors>
<mirror>
<id>nexus</id>
<url>http://myserver/nexus/content/groups/public</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
<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>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>

似乎必须明确告诉 Maven Nexus 提供的存储库组也可以包含快照修订。据推测,这样做会触发 Maven 开始寻找特殊的元数据文件,这些文件用于发现哪个带时间戳的文件实际上是最新的快照。

关于java - 为什么 Jenkins 不下载我的最新快照?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12302457/

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