Hey folks, sorry newb here. What's best practice l...
# gradle
t
Hey folks, sorry newb here. What's best practice like for managing dependency versions? Coming from JS/yarn i use to run
yarn upgrade-interactive
regularly to upgrade all my dependencies to the latest versions (SEM ver'd so I could skip out MAJOR changes as well). Can I specify a package range in the dependencies block i.e.,
implements("io.github.cdimascio:java-dotenv:>5")
or is there a grandle command which will update all packages to the latest published version?
b
i use
Copy code
com.github.ben-manes.versions
plugin in gradle to find dependency updates .. you still have to edit your gradle file manually though
t
great thanks 🙂
c
There's also built-in dynamic versions support: https://docs.gradle.org/current/userguide/dynamic_versions.html This is closer to what you're asking judging by the pseudo-code example you specified.
t
ahh that looks very good 🙏
i'll have to try both out!
b
you can do that as well but keep in mind when you specify a version with + you don't really know what is happening and it can have surprising results 🙂
🤔 1
t
Do most projects adhere to SEMVER rules or is it hit and miss in the java/kotlin ecosystem? I.e. I'd like to specify version 1.1.+ to have PATCH releases automagically included. I'm coming from the JS ecosystem were it's mostly fine to pull in MINOR and PATCH releases regularly and even if it's breaking tests generally catch the breakage
b
i do it only for test dependencies .. you can call me a chicken 😉
t
haha fair enough! it all depends on your risk profile!! 🙂