Is it possible to have multiple repos in a resolve closure for the Artifactory Gradle plugin?

依然范特西╮ 提交于 2019-12-09 16:13:58

问题


I have not been able to resolve against two repositories (ext-releases-local and repo1-cache) on one Artifactory server. My build seems to only resolve against the last repository in the list and ignore the first one. Basically, I have my project's dependencies in ext-releases-local, and their transitive dependencies can be found in the remote repository called repo1-cache. So I need to resolve against both using the Artifactory Gradle plugin. Here is the setup that I have tried in my build.gradle:

artifactory {
  contextUrl = "https://myartifactory.host.com"
  publish {
    repository {
      repoKey = "myproj-releases-local"
      username = "${artifactory_deployer_user}"
      password = "${artifactory_deployer_password}"
    }
  }
  resolve {
    repository {
      repoKey = "repo1-cache"
      username = "${artifactory_reader_user}"
      password = "${artifactory_reader_password}"
    }
    repository {
      repoKey = "ext-releases-local"
      username = "${artifactory_reader_user}"
      password = "${artifactory_reader_password}"
    }
  }
}

I would appreciate any help/advice on getting this to work. There isn't any documentation out on jfrog's website to tell whether resolving to two repos is supported or not. It's definitely possible to do it without the Artifactory Gradle plugin, but unfortunately I will be building via Bamboo, and the Artifactory Gradle plugin has become necessary for release management.


回答1:


From what I can tell, this isn't supported. However, you can always create a virtual repository on the Artifactory side that includes ext-releases-local and repo1-cache. (There is also a predefined virtual repository named /repo that includes all repositories.) As a nice side effect, this will likely perform better than declaring two repositories on the Gradle side.



来源:https://stackoverflow.com/questions/23021321/is-it-possible-to-have-multiple-repos-in-a-resolve-closure-for-the-artifactory-g

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!