Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve dependency conflict of an SBT dependency?

I have a project's build.sbt which is using :

libraryDependencies ++= Seq(
   "com.lerestau" % "killer-launcher" % "1.0.2",
   "com.lerestau" % "menu-starter" % "1.0.0"
)

menu-starter transitively downloading "killer-launcher" % "0.0.8" and Hence getting errors in current project. Is there any way to resolve this sort of conflict. I came up with dependencyOverrides, but that works if conflict is entirely binary. That didn't work. How to resolve in SBT?

like image 577
Vikas Sharma Avatar asked Mar 30 '16 09:03

Vikas Sharma


People also ask

Where are sbt dependencies stored?

If you have JAR files (unmanaged dependencies) that you want to use in your project, simply copy them to the lib folder in the root directory of your SBT project, and SBT will find them automatically.

How do you update dependencies in Scala?

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

How do I clear my sbt cache?

You can use Pretty Clean to clean the all of dev tools caches including SBT. PrettyClean also cleans the SBT project's target folder.


1 Answers

The following should get rid of the transitive dependency of menu-starter on the older killer-launcher version:

libraryDependencies ++= Seq(
  "com.lerestau" % "killer-launcher" % "1.0.2",
  "com.lerestau" % "menu-starter" % "1.0.0" exclude("com.lerestau", "killer-launcher"
)  

More details can be found in the documentation unfortunately there doesn't seem to be a way to link directly to the relevant section.

like image 125
Bert Geens Avatar answered Oct 23 '22 05:10

Bert Geens