New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mavenBom doesn't obey cacheChangingModulesFor
for -SNAPSHOT bom
#38
Comments
cacheChangingModulesFor
for -SNAPSHOT bom
I encountered the same issue - it seems that the 'resolutionStrategy' doesn't apply to the BOM. Not sure if this is a Gradle limitation or a plugin limitation |
wow that was fast 👍 We've found out that the plugin actually obeys the |
The plugin uses detached configurations. One for "global" dependency management that applies to every configuration and then separate configurations for each configuration-specific dependency management. The detached configurations aren't added to the configuration container so they're not in I chose to use detached configurations as I wanted to avoid "cluttering up" people's builds with, what I had considered to be, an implementation detail of the plugin. I think your requirement to control the caching behaviour shows that it's not just an implementation detail. It would be quite straightforward to stop using detached configurations and expose them named something like Thoughts? |
I think it would be useful that those configurations are exposed, as long as their names are clearly identifiable as 'coming from dependency management plugin'. In our workflow, depending on a -SNAPSHOT bom during development is essential, so we definitely need control over the cache of that artifact. Something to think about is also that these "configurations" then become part of the plugin surface / API, and backward compatibility over them should be considered. |
I spoke too soon. There are some significant implementation benefits to treating the configuration(s) used to resolve imported boms separately, for example it makes it trivial to stop the plugin from trying to provide dependency management for its own configurations.
I'll expose some other mechanism for configuring |
That would work perfectly, thank you! |
The dependencyManagement {
resolutionStrategy {
cacheChangingModulesFor 0, 'seconds'
}
} @flozano If you have a moment, please try 0.4.1.BUILD-SNAPSHOT available from https://repo.spring.io/plugins-snapshot. |
Tried and seems to work:
However, #39 now happens even without --refresh-dependencies. I will keep trying to isolate that. |
Thanks for trying out the snapshot
That's reassuring in a way. From the plugin's perspective the behaviour should be the same as both have the effect of disabling caching. |
I have
(where 'version' is something like 1.2.3-SNAPSHOT).
However, when the BOM is already in the gradle cache, gradle doesn't try to re-download again, even if there is a new SNAPSHOT version in the repository.
The text was updated successfully, but these errors were encountered: