问题
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