1

My setup is a jenkins that polls my git repo and does publish to a nexus repo on each push. Then I have a downstream project that takes this artifact and deploys it to a test server. This project is using artifact resolver plugin for jenkins and just uses "LATEST" as version.

What I notice is the following. After I have published a new snapshot the metadata is only updated in the specific version folder. The specific version metadata is correct:

https://repo.woodenstake.se/content/repositories/snapshots/se/uniply/dfkka_2.10/1.2.7-SNAPSHOT/maven-metadata.xml:

<metadata modelVersion="1.1.0">
<groupId>se.uniply</groupId>
<artifactId>dfkka_2.10</artifactId>
<version>1.2.7-SNAPSHOT</version>
<versioning>
<lastUpdated>20130524112854</lastUpdated>
</versioning>
</metadata>

https://repo.woodenstake.se/content/repositories/snapshots/se/uniply/dfkka_2.10/maven-metadata.xml

shows an old timestamp:

<metadata modelVersion="1.1.0">
<groupId>se.uniply</groupId>
<artifactId>dfkka_2.10</artifactId>
<versioning>
<latest>1.2.7-SNAPSHOT</latest>
<release/>
<versions>
<version>1.2.7-SNAPSHOT</version>
</versions>
<lastUpdated>20130523200733</lastUpdated>
</versioning>
</metadata>

Therefore artifact resolver doesn't download the latest version but just uses the cached one from a local directory. Why doesn't Nexus update the version? Is there any setting I missed?

More info:

I'm using sbt 12.2 with publish plugin (ivy under the hood).

4

3 回答 3

2

我也在 SBT google 小组中问过这个问题: https ://groups.google.com/forum/?fromgroups#!topic/simple-build-tool/ErA1ybeRXec

在做了更多研究之后,这个线程

https://groups.google.com/forum/?fromgroups#!topic/simple-build-tool/okaoV3SDH24

似乎表明它的常春藤不会以使用 Maven 时预期的方式放置这些文件。一种解决方案是使用 SBT 的 Aether-plugin 来“部署”Maven 方式而不是“发布”。

https://github.com/arktekk/sbt-aether-deploy

使用这个,xml:s 也使用 SBT 构建中的 PUT:s 进行了更新。

于 2013-05-24T13:14:18.647 回答
1

Nexus 实际上根本不维护这些文件。构建系统就是这样做的。如果您使用的是 Maven,则部署插件会处理它。

似乎 ivy 的 sbt 没有正确地做到这一点。我建议按照@hedefalk 的建议集成 sbt-aether-deploy 工具。

作为权宜之计,您可以定期在存储库上运行重建元数据任务。

于 2013-05-31T20:05:09.833 回答
0

其他与常春藤和 Maven 快照版本相关的答案:

总之,快照发布是 ivy 不完全支持的 Maven 功能。

于 2013-05-24T19:11:14.717 回答