Gradle: How to use specific version of snapshot?

最后都变了- 提交于 2019-12-10 19:47:43

问题


I'm using SNAPSHOT version of graphhopper library.

Is there posibility to use older version of snapshot? I tried:

 compile(group: 'com.graphhopper', name: 'graphhopper', version: '0.6-20151126.110118-54') {  

    exclude group: 'com.google.protobuf', module: 'protobuf-java'
    exclude group: 'org.openstreetmap.osmosis', module: 'osmosis-osm-binary'
    exclude group: 'org.apache.xmlgraphics', module: 'xmlgraphics-commons'
}

As repository I use: maven { url "https://oss.sonatype.org/content/groups/public/" }

I've tried also this repository:

maven {url "https://oss.sonatype.org/content/repositories/snapshots/"}

but it also cannot be found.

Could not find com.graphhopper:graphhopper:0.6-20151126.110118-54.
 Searched in the following locations:
     https://jcenter.bintray.com/com/graphhopper/graphhopper/0.6-20151126.110118-54/graphhopper-0.6-20151126.110118-54.pom
     https://jcenter.bintray.com/com/graphhopper/graphhopper/0.6-20151126.110118-54/graphhopper-0.6-20151126.110118-54.jar
     https://oss.sonatype.org/content/groups/public/com/graphhopper/graphhopper/0.6-20151126.110118-54/graphhopper-0.6-20151126.110118-54.pom
     https://oss.sonatype.org/content/groups/public/com/graphhopper/graphhopper/0.6-20151126.110118-54/graphhopper-0.6-20151126.110118-54.jar
     file:/D:/adt-bundle-windows-x86/sdk/extras/android/m2repository/com/graphhopper/graphhopper/0.6-20151126.110118-54/graphhopper-0.6-20151126.110118-54.pom
     file:/D:/adt-bundle-windows-x86/sdk/extras/android/m2repository/com/graphhopper/graphhopper/0.6-20151126.110118-54/graphhopper-0.6-20151126.110118-54.jar
     file:/D:/adt-bundle-windows-x86/sdk/extras/google/m2repository/com/graphhopper/graphhopper/0.6-20151126.110118-54/graphhopper-0.6-20151126.110118-54.pom
     file:/D:/adt-bundle-windows-x86/sdk/extras/google/m2repository/com/graphhopper/graphhopper/0.6-20151126.110118-54/graphhopper-0.6-20151126.110118-54.jar

I have tried also using local path to the gradle cache (after deleting newest snapshot dirs and leaving version I want to use) but no success. If it's impossible, is there any way to stop downloading new SNAPSNOT versions?

Thanks for help.


回答1:


Check out this link: https://issues.gradle.org/browse/GRADLE-2784 Should have been fixed in April. Which Gradle version do you use?




回答2:


This is fixed in Gradle 2.4 by GRADLE-2784, see the gradle 2.4 release notes.

NB: you shouldn't include the word SNAPSHOT in the artifact version, eg:

dependencies {
  compile "org.company:my-lib:1.0.0-20150102.010203-20"
}


来源:https://stackoverflow.com/questions/34086417/gradle-how-to-use-specific-version-of-snapshot

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