有没有办法检索maven时间戳的工件,因为它最初是由maven上传的?
Uploading: http://artifactory.foo/artifactory/libs-snapshot-local/com/foo/foo-web-service/1.16.0-SNAPSHOT/foo-web-service-1.16.0-20160504.182015-2.tar.gz
来自神器REST api的结果:
$ curl -X GET 'http://artifactory.foo/artifactory/api/search/gavc?g=com.foo&a=foo-web-service&v=1.16.0-SNAPSHOT&c=*&repos=libs-snapshot-local'
{
"results" : [ {
"uri" : "http://artifactory.foo/artifactory/api/storage/libs-snapshot-local/com/foo/foo-web-service/1.16.0-SNAPSHOT/foo-web-service-1.16.0-SNAPSHOT-sources.jar"
}, {
"uri" : "http://artifactory.foo/artifactory/api/storage/libs-snapshot-local/com/foo/foo-web-service/1.16.0-SNAPSHOT/foo-web-service-1.16.0-SNAPSHOT.pom"
}, {
"uri" : "http://artifactory.foo/artifactory/api/storage/libs-snapshot-local/com/foo/foo-web-service/1.16.0-SNAPSHOT/foo-web-service-1.16.0-SNAPSHOT.tar.gz"
}, {
"uri" : "http://artifactory.foo/artifactory/api/storage/libs-snapshot-local/com/foo/foo-web-service/1.16.0-SNAPSHOT/foo-web-service-1.16.0-SNAPSHOT.war"
} ]
}
我希望获得与通过wget或等效内容上传的名称相同的名称...
我想要实现的目标:
我目前所做的并不能满足我的需要:
结论如接受的答案中所述,问题出现在artifactory配置本身。为了实现我想要的,我需要快照是独一无二的。
答案 0 :(得分:2)
只要您的存储库配置为使用唯一快照(或使用客户端快照策略并使用Maven 3及更高版本),您始终可以将Maven时间戳用作版本。用-SNAPSHOT
替换它是"运行时"使分辨率更容易的技巧。
如果您的存储库配置为使用非唯一快照,则文件实际上与-SNAPSHOT
而不是版本一起存储,并覆盖以前的快照(不要那样做)。