从Graifact中下载Artifactory的最新版本

时间:2013-10-31 13:36:58

标签: gradle ivy artifactory

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'

有没有办法让gradle和常春藤从神器中取出最新版本?

1 个答案:

答案 0 :(得分:1)

我能够使用常春藤语法来实现这一点:

compile "org.acme:acme:1.0.0.9.+"

这解决了我遇到的问题,但我从来没有设法使用Artifactory [RELEASE]网址。