I have added the following jar to build.sbt
file as follows:
"com.amazonaws" % "aws-java-sdk" % "1.11.492"
Post this ,during merge , I am getting the following error :
[error] 1 error was encountered during merge
java.lang.RuntimeException: deduplicate: different file contents found in the following:
/home/jenkins-slave/.ivy2/cache/io.netty/netty-codec-http/jars/netty-codec-http-4.1.17.Final.jar:META-INF/io.netty.versions.properties
/home/jenkins-slave/.ivy2/cache/io.netty/netty-handler/jars/netty-handler-4.1.17.Final.jar:META-INF/io.netty.versions.properties
/home/jenkins-slave/.ivy2/cache/io.netty/netty-codec/jars/netty-codec-4.1.17.Final.jar:META-INF/io.netty.versions.properties
/home/jenkins-slave/.ivy2/cache/io.netty/netty-transport/jars/netty-transport-4.1.17.Final.jar:META-INF/io.netty.versions.properties
/home/jenkins-slave/.ivy2/cache/io.netty/netty-resolver/jars/netty-resolver-4.1.17.Final.jar:META-INF/io.netty.versions.properties
/home/jenkins-slave/.ivy2/cache/io.netty/netty-buffer/jars/netty-buffer-4.1.17.Final.jar:META-INF/io.netty.versions.properties
/home/jenkins-slave/.ivy2/cache/io.netty/netty-common/jars/netty-common-4.1.17.Final.jar:META-INF/io.netty.versions.properties
at sbtassembly.Assembly$.applyStrategies(Assembly.scala:143)
at sbtassembly.Assembly$.x$1$lzycompute$1(Assembly.scala:25)
at sbtassembly.Assembly$.x$1$1(Assembly.scala:23)
at sbtassembly.Assembly$.stratMapping$lzycompute$1(Assembly.scala:23)
at sbtassembly.Assembly$.stratMapping$1(Assembly.scala:23)...........
I have tried many workarounds provided for this like:
1) added this line in assemblyMergeStrategy
in build.sbt
:case PathList("io", "netty", xs @ _*) => MergeStrategy.discard
(tried with .last
and .first
)
2)added this line in assemblyMergeStrategy
in build.sbt
:case "META-INF\\io.netty.versions.properties" =>MergeStrategy.first
(tried with .last
and .discard
)
3)added SBT exclusion rules for the errored out netty jars in excludedDependencies like below:
excludeDependencies ++= Seq(
SbtExclusionRule("io.netty", "netty-codec-http"),
SbtExclusionRule("io.netty", "netty-codec"),
SbtExclusionRule("io.netty", "netty-handler"),
SbtExclusionRule("io.netty", "netty-transport"),
SbtExclusionRule("io.netty", "netty-resolver"),
SbtExclusionRule("io.netty", "netty-buffer"),
SbtExclusionRule("io.netty", "netty-common")
)
and many such variations of the above.None of these solutions are working.
plugins.sbt
looks like below:
addSbtPlugin("io.spray" % "sbt-revolver" % "0.7.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.5.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.1")
addSbtPlugin("com.scalapenos" % "sbt-prompt" % "0.2.1")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.1.10")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.0")
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
Kindly advise.
"com.amazonaws" % "aws-java-sdk" % "1.11.492" excludeAll ExclusionRule(organization = "io.netty")
? In our build it iscase "META-INF/io.netty.versions.properties" => MergeStrategy.first
btw – Ursulaursulette