我有一个针对Maven 3项目的Jenkins构建工作。该项目具有SNAPSHOT依赖项。构建失败,因为Maven找不到SNAPSHOT工件,该工件已部署到Intranet Sonatype Nexus存储库。SNAPSHOT存储库是“公共”组的一部分,“公共”组是的镜像URL <mirrorOf>*</mirrorOf>
。
Jenkins配置为在工作区本地创建一个本地Maven存储库(每个作业一个重新存储)。
所有其他非快照依赖关系都已得到很好的解决和下载。没有SNAPSHOT依赖项的项目的其他作业也已成功建立。到目前为止我尝试过的事情(没有成功):
我的设置:
Windows Server 2003
Java 1.6.0_31
Jenkins 1.480
Maven 3.0.3
这可能是我也发现的“陷阱”,是从Nexus下载快照修订版。
该解决方案在Nexus书中提供,但未完整说明:
<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提供的存储库组也可以包含Snapshot修订版。大概这样做是触发Maven开始寻找特殊的元数据文件,这些特殊的元数据文件用于发现哪个带有时间戳的文件实际上是最新的快照。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句