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

Zee*_*mee 5 java maven jenkins

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

  • Nexus中的缓存已过期
  • 检查了本地存储库(在作业目录中)-没有工件目录
  • 在作业配置中将“构建->目标和选项”设置为“ -U全新安装”
  • 等一小时

我的设置:
Windows Server 2003
Java 1.6.0_31
Jenkins 1.480
Maven 3.0.3

Mar*_*nor 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>
Run Code Online (Sandbox Code Playgroud)

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