Artifactory具有其API的功能,您可以在其中下载最新版本的jar文件(请参阅http://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-RetrieveLatestArtifact)。
他们的例子是:
GET http:// localhost:8080 / artifactory / ivy-local / org / acme / [RELEASE] / acme- [RELEASE] .jar
我正在一个项目,其中所有版本都已发布,我想从上一个版本中获取jar。所以我要寻找的是在gradle中这样的依赖项:
compile "org.acme:acme:1.0.0.9.[RELEASE]"
由于方括号转义而导致失败,因此我尝试了以下操作:
compile "org.acme:acme:1.0.0.9.%5BRELEASE%5D"
这似乎允许gradle / ivy查找文件,但是失败了,因为.pom文件版本与定义的文件版本不匹配。
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':project:compile'.
> Could not resolve org.acme:acme:1.0.0.9.%5BRELEASE%5D.
Required by:
org.acme:acme:unspecified
> Could not resolve org.acme:acme:1.0.0.9.%5BRELEASE%5D.
> inconsistent module metadata found. Descriptor: CachedResource: /Users/xxxx/.gradle/caches/artifacts-26/filestore/org.acme/acme/1.0.0.9.%5BRELEASE%5D/pom/3986d9c1a27873ce92c0dbd089fc1ca9618f8c1a/acme-1.0.0.9.%5BRELEASE%5D.pom for http://localhost/artifactory/org/acme/acme/1.0.0.9.%5BRELEASE%5D/acme-1.0.0.9.%5BRELEASE%5D.pom Errors: bad version: expected='1.0.0.9.%5BRELEASE%5D' found='1.0.0.9.80'
有什么办法让gravy和ivy从人工制品中获取最新版本?
最佳答案
我能够使用ivy语法使它正常工作:
compile "org.acme:acme:1.0.0.9.+"
这解决了我遇到的问题,但是我从未设法使用Artifactory [RELEASE]网址使其正常工作。
关于gradle - 使用Gradle从Artifactory下载最新版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19708020/