1

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 和 ivy 从 artifactory 中提取最新版本?

4

1 回答 1

1

我能够使用 ivy 语法来完成这项工作:

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

这解决了我遇到的问题,但我从来没有设法使用 Artifactory [RELEASE] url 让它工作。

于 2013-10-31T14:16:00.233 回答