I've been trying it to see if it'd achieve what I'...
# dependency-management
s
I've been trying it to see if it'd achieve what I'm looking at doing in the above post ☝️ with
failOnChangingVersions()
for a resolutionStrategy. https://docs.gradle.org/current/userguide/resolution_strategy_tuning.html I tried in a sample project but couldn't figure out how to create a scenario where it showed value. Not quite sure what
failOnChangingVersions()
does? Any ideas?
o
"changing versions" means
-SNAPSHOT
, I think it's possible for other ones to be "changing" but that's the only example I know of.
basically, if you have
implementation("my.dep:artifact:1.0-SNAPSHOT")
,
failOnChangingVersions()
will cause an error
s
Thanks for the clarity @Octavia Togami! That's unexpected, but makes sense.
Okay, I added a
-SNAPSHOT
dependency and now see (screenshot). Which confirms what you said.
Is there a verify task or something I can run that will fail? This
module:dependencies
task succeeds, even though it says "FAILURE" when trying to resolve.
o
that is intentional, as the dependencies task wouldn't be able to print its output otherwise. you can make your own task to resolve all configurations if you want, but I don't think there's anything built-in. I usually use
assemble
or even just
compileJava
as my "cheap" task to do resolution, as if the resolution fails it's the same as if you made a dedicated task.
s
That's the thing, that
assemble
succeeds fine, even with this. But... I am not relying on any classes from that module.
Okay, thank you for your answers! I think that means the the plugin I have made has a real purpose! Which is good since I spent a week on it.