Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically update sbt dependencies to latest version

Tags:

scala

sbt

While there are many questions dealing with unresolved sbt dependencies, there seems to be no general way to update these.

Do you need to check maven central for each one by hand, or is there some nifty tool that can automatically update them to the latest version?

like image 226
serv-inc Avatar asked Jan 22 '19 07:01

serv-inc


2 Answers

I've used the sbt-updates plugin for this purpose locally for many years—simply add it to your local sbt user configuration and then run sbt dependencyUpdates in your project directory, and you'll get a list of dependencies that have updates in Maven Central (or whatever other repositories you have configured for that project).

The scala-steward bot builds on sbt-updates to provide GitHub pull requests for dependency updates. You can either add your projects to the main instance's configuration if they're open source (I do this personally for 15-20 projects, and while it's not perfect, it's hugely useful, and getting better all the time), or run your own instance (which I've not tried personally).

Note that neither of these choices verifies that the dependency updates are compatible with each other—just that they're the latest. You'll still need to watch carefully for evictions, etc.

like image 174
Travis Brown Avatar answered Oct 24 '22 18:10

Travis Brown


Try out sbt-dependency-updates sbt plugin. It has dependencyUpgrade task (experimental) to upgrade of project dependencies and plugins that can be updated.

like image 33
Alexander Shagin Avatar answered Oct 24 '22 17:10

Alexander Shagin