Gradle non-managed remote dependency

寵の児 提交于 2019-12-13 04:51:28

问题


I have a jar dependency that resides on a remote server. How do I resolve that in Gradle? There doesn't seem to be a way to define a repository for remote files, only local files, and I'm something like this doesn't seem to work either:

compile("group:name:version") {
  artifact {
    url = "http://server/dep.jar"
  }
}

The docs seems to hint that something like this should be possible, but so far I'm unable to find an example anywhere.

Support for non-managed dependencies: If your dependencies are simply files in version control or a shared drive, Gradle provides powerful functionality to support this.

Any ideas?


回答1:


Unfortunately, according to gradle documentation a remote share is currently not supported. However, this can be worked-around easily by doing the following:

  1. Copy that will copy the remote jars locally. A possible location for such code can be the repositories configuration to ensure that the files will be copied before the dependencies will get resolved.
  2. Define a local repository pointing to the local location of jars.


来源:https://stackoverflow.com/questions/29020073/gradle-non-managed-remote-dependency

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