I’ve searched these forums as well as SO. On these forums I found nothing that exactly matches the problem I am seeing, even though it seems like the most basic of SNAPSHOT resolution problems. On SO I only found (seemingly) out-of-date solutions that do not fix the problem. So I apologize up front if I missed something - please free to point me to the information I missed
All that said I am having trouble getting SNAPSHOT dependencies to be resolved properly. The generalized problem is that Gradle has trouble recognizing newer SNAPSHOT versions.
I have a pretty basic dependency:
ext {
hibernateVersion = '5.3.0-SNAPSHOT'
}
dependencies {
compile( “org.hibernate:hibernate-core:${hibernateVersion}” )
compile( “org.hibernate:hibernate-testing:${hibernateVersion}” ) {
transitive = false
}
}
When I publish new SNAPSHOTs of these Gradle will often ignore the newer ones. I’ve tried one consistent suggestion I found on SO:
configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
ext {
hibernateVersion = ‘5.3.0-SNAPSHOT’
}
dependencies {
compile( “org.hibernate:hibernate-core:${hibernateVersion}” ) {
changing = true
}
compile( “org.hibernate:hibernate-testing:${hibernateVersion}” ) {
transitive = false
changing = true
}
}
However, even this does not work. So as an example, I perform a publish on hibernate-core:
Upload https://repository.jboss.org/nexus/content/repositories/snapshots/org/hibernate/hibernate-core/5.3.0-SNAPSHOT/hibernate-core-5.3.0-20171128.145357-16.jar
But Gradle does not “see” this version, instead keeping the one it previously downloaded:
Download http://repository.jboss.org/nexus/content/groups/public/org/hibernate/hibernate-core/5.3.0-SNAPSHOT/hibernate-core-5.3.0-20171128.034434-15.jar
As you can see the versions are not the same. And to clarify, this repo makes these uploaded artifacts available immediately so there is no “latency” problem.
Interestingly, after 24 hours it does now see the newer version. I say 24 hours because AFAIK that is the Gradle default handling for SNAPSHOT dependencies, although all I can really say definitively is that it is after some “significant” amount of time" has passed.
So its essentially like Gradle either does not see these dependency/configuration changes or accept/honor them.
How do I fix this? Thanks in advance