Open anilkumarmyla opened 4 years ago
Original issue filed at https://github.com/cb372/sbt-explicit-dependencies/issues/51
Given below deps in build.sbt and latest sbt eco-system
libraryDependencies ++= Seq( "com.github.jknack" % "handlebars" % "4.1.2", "com.github.jknack" % "handlebars-jackson2" % "4.1.2" )
this code with underscore import reports handlebars-jackson2 unused, while switching to expanding the import passes the unused dependencies test
handlebars-jackson2
package foo.bar import com.fasterxml.jackson.databind.ObjectMapper //import com.github.jknack.handlebars.{Context, JsonNodeValueResolver} import com.github.jknack.handlebars._ import com.github.jknack.handlebars.context.{FieldValueResolver, JavaBeanValueResolver, MapValueResolver, MethodValueResolver} object ExampleLibrary { val mapper = new ObjectMapper() def getContext(jsonStr: String): Context = { Context .newBuilder(mapper.readTree(jsonStr)) .resolver( JsonNodeValueResolver.INSTANCE, JavaBeanValueResolver.INSTANCE, FieldValueResolver.INSTANCE, MapValueResolver.INSTANCE, MethodValueResolver.INSTANCE ) .build } }
This is likely a bug in sbt/zinc not reporting the Relations highlighted below when using underscore import
[debug] library deps: Relation [ ... [debug] src/main/scala/foo/bar/ExampleLibrary.scala -> /Users/anilkumarmyla/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/jknack/handlebars-jackson2/4.1.2/handlebars-jackson2-4.1.2.jar ... [debug] library class names: Relation [ [debug] /Users/anilkumarmyla/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/jknack/handlebars-jackson2/4.1.2/handlebars-jackson2-4.1.2.jar -> com.github.jknack.handlebars.JsonNodeValueResolver ...
@anilkumarmyla Thanks for the report.
Original issue filed at https://github.com/cb372/sbt-explicit-dependencies/issues/51
Given below deps in build.sbt and latest sbt eco-system
this code with underscore import reports
handlebars-jackson2
unused, while switching to expanding the import passes the unused dependencies testThis is likely a bug in sbt/zinc not reporting the Relations highlighted below when using underscore import