SBT: Is it Wise to Fix Library Dependency Warning

Can SBT evictions be corrected?

Redefining the version of the carved libraries to the latest. Will this force SBT to stick to the redefined version for life? Will SBT still notify us that newer versions exist in the future?

Eviction Alert Example (SBT 0.13.13)

[warn] There may be incompatibilities among your library dependencies. [warn] Here are some of the libraries that were evicted: [warn] * com.chuusai:shapeless_2.11:1.2.4 -> 2.3.2 [warn] * org.postgresql:postgresql:9.4-1201-jdbc41 -> 9.4.1208.jre7 [warn] * jline:jline:0.9.94 -> 2.12.1 [warn] Run 'evicted' to see detailed eviction warnings 

Remove the warnings by adding this to the end of build.sbt. Following the instructions in the SBT documentation Eviction Warning

 dependencyOverrides ++= Set( "org.postgresql" % "postgresql" % "9.4.1208.jre7", "com.chuusai" %% "shapeless" % "2.3.2", "jline" % "jline" % "2.12.1" ) 
+5
source share
1 answer

If these warnings relate to dependencies that you use directly in your code, be sure to add the updated version to your libraryDependencies .

For derived transitive dependencies (those dependencies that are used directly by your dependencies), most likely, just leave warnings in place. This provides you with documentation of possible incompatibilities in your dependencies and can help you debug runtime problems arising from such incompatibilities.

Remember that installing dependencyOverrides simply hides the warning, this does not guarantee compatibility between your libraries and the version you have installed.

+10
source

Source: https://habr.com/ru/post/1264856/


All Articles