We have one gradle dependency, that has the same name but is changing a lot, so we want to always get it anew. The dependency is stored in artifactory, and the contents are:
entity-configurator-0.6.2-staging-sources.jar 12-Jun-2019 09:33 110.19 KB
entity-configurator-0.6.2-staging.jar 12-Jun-2019 09:33 147.37 KB
entity-configurator-0.6.2-staging.pom 12-Jun-2019 09:33 3.01 KB
We used the resolution strategy described here https://stackoverflow.com/a/14804849. This is the build.gradle code.
configurations.all {
resolutionStrategy {
cacheDynamicVersionsFor 0, "seconds"
cacheChangingModulesFor 0, "seconds"
}
}
...
...
compile ('com.***:entity-configurator:0.6.2-staging') { changing = true }
This should force the gradle to always check if the dependency is up to date. Which is probably doing, but not correctly, as when I run
./gradlew build --info
the output is
> Task :compileJava
Cached resource https://artifactory.***.net/artifactory/libs-staging-local/com/***/entity-configurator/0.6.2-staging/entity-configurator-0.6.2-staging.pom is up-to-date (lastModified: Wed Jun 12 11:33:33 CEST 2019).
Cached resource https://artifactory.***.net/artifactory/libs-staging-local/com/***/entity-configurator/0.6.2-staging/entity-configurator-0.6.2-staging.jar is up-to-date (lastModified: Wed Jun 12 12:12:36 CEST 2019).
Skipping task ':compileJava' as it is up-to-date.
In this case, the dependency itself was updated in artifactory, but is not updated in my project after I refresh gradle. The problem here is, they are 2 different parts of the wanted dependency ( the .jar and .pom), and both have different lastModified time.
Cached resource https://artifactory.***.net/artifactory/libs-staging-local/com/***/0.6.2-staging/entity-configurator-0.6.2-staging.pom is up-to-date (lastModified: Wed Jun 12 11:33:33 CEST 2019).
vs
Cached resource https://artifactory.***.net/artifactory/libs-staging-local/com/***/0.6.2-staging/entity-configurator-0.6.2-staging.jar is up-to-date (lastModified: Wed Jun 12 12:12:36 CEST 2019).
The .jar file time of last modified is correct, the pom is apparently from previous version of the dependency. When I check the .gradle/cache folder after refreshing the project, there is the new .jar file, but .pom is still from the previous version. Anybody knows what the problem here is and how to resolve it? I really don't understand why the .pom file is not being updated.