DeDuplication error with SBT assembly plugin

Rajeev

I am trying to create an executable jar using SBT assembly plugin.

I am ending up with below error :

[error] (app/*:assembly) deduplicate: different file contents found in the following:
[error] /Users/rajeevprasanna/.ivy2/cache/org.eclipse.jetty.orbit/javax.servlet/orbits/javax.servlet-3.0.0.v201112011016.jar:about.html
[error] /Users/rajeevprasanna/.ivy2/cache/org.eclipse.jetty/jetty-continuation/jars/jetty-continuation-8.1.8.v20121106.jar:about.html
[error] /Users/rajeevprasanna/.ivy2/cache/org.eclipse.jetty/jetty-http/jars/jetty-http-8.1.8.v20121106.jar:about.html
[error] /Users/rajeevprasanna/.ivy2/cache/org.eclipse.jetty/jetty-io/jars/jetty-io-8.1.8.v20121106.jar:about.html
[error] /Users/rajeevprasanna/.ivy2/cache/org.eclipse.jetty/jetty-security/jars/jetty-security-8.1.8.v20121106.jar:about.html
[error] /Users/rajeevprasanna/.ivy2/cache/org.eclipse.jetty/jetty-server/jars/jetty-server-8.1.8.v20121106.jar:about.html
[error] /Users/rajeevprasanna/.ivy2/cache/org.eclipse.jetty/jetty-servlet/jars/jetty-servlet-8.1.8.v20121106.jar:about.html
[error] /Users/rajeevprasanna/.ivy2/cache/org.eclipse.jetty/jetty-util/jars/jetty-util-8.1.8.v20121106.jar:about.html
[error] /Users/rajeevprasanna/.ivy2/cache/org.eclipse.jetty/jetty-webapp/jars/jetty-webapp-8.1.8.v20121106.jar:about.html
[error] /Users/rajeevprasanna/.ivy2/cache/org.eclipse.jetty/jetty-xml/jars/jetty-xml-8.1.8.v20121106.jar:about.html
[error] Total time: 2562 s, completed Dec 5, 2013 12:03:25 PM

After reading wikis of assembly plugin, i have added merge strategy in build.scala file. Seems it is not working. I am not sure whether it is right fix or not. Can someone suggest me the right strategy.

Below is the code which i have in build.scala file :

mergeStrategy in assembly <<= (mergeStrategy in assembly) {
      (old) => {
        case "about.html" => MergeStrategy.discard
        case "logback.xml" => MergeStrategy.first //case PathList("logback.xml") => MergeStrategy.discard
        case x => old(x)
      }
    }

I have coded plugin integration with my app as per this doc : Standalone deployment of Scalatra servlet

I tried diffrent strategies like MergeStrategy.rename and MergeStrategy.deduplicate. But nothing works.. Looking for help...

Eugene Yokota

Your MergeStrategy looks correct. The only unhandled conflicts are "about.html" in the jetty jars, so case "about.html" => MergeStrategy.discard should just do it.

If you're still getting the error, I suspect that re-wiring of the mergeStrategy in assembly setting is either not going in, or going in the wrong order. The only way to know for sure is to see your Build.scala. @Stefan Ollinger's answer to your linked question for example sets up the project as follows:

lazy val project = Project("myProj", file(".")).
  settings(mySettings: _*).
  settings(myAssemblySettings:_*)

Could you post your Build.scala on gist if possible?

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

DeDuplication error with SBT assembly plugin

From Dev

error while running sbt assembly : sbt deduplication error

From Dev

error while running sbt assembly : sbt deduplication error

From Dev

Slick 3.1.1 deduplication errors with sbt-assembly

From Dev

Slick 3.1.1 deduplication errors with sbt-assembly

From Dev

SBT Scala Assembly Plugin

From Dev

Apache Spark, Error on sbt/assembly

From Dev

Deduplication in build.sbt

From Dev

Error with maven build with assembly plugin

From Dev

How to exclude transitive dependency in Sbt ( in context of assembly plugin )?

From Dev

sbt assembly plugin includes "provided" libraries and it's lineage

From Dev

sbt assembly error - deduplicate: different file contents found in the following

From Dev

sbt assembly error - deduplicate: different file contents found in the following

From Dev

Should sbt-assembly perform a "maven-shade-plugin"-like relocation of classes?

From Dev

SBT assembly jar exclusion

From Dev

sbt assembly command not found

From Dev

trying to use sbt assembly

From Dev

maven-assembly-plugin gives java heap space error

From Dev

Specflow plugin : Generation error: Missing [assembly:GeneratorPlugin] attribute in

From Dev

Running an uber jar from sbt assembly results in error: Could not find or load main class

From Dev

"./sbt/sbt assembly" errors "Not a valid command: assembly" for Apache Spark project

From Dev

Using a custom sbt plugin

From Dev

SBT Plugin that adds Plugins

From Dev

Using a custom sbt plugin

From Dev

sbt publish assembly jar with a pom

From Dev

Increase memory in sbt-assembly

From Dev

SBT build file not recognizing "assembly"

From Dev

SBT Assembly not working (not a valid command)

From Dev

sbt-assembly not including dependencies

Related Related

  1. 1

    DeDuplication error with SBT assembly plugin

  2. 2

    error while running sbt assembly : sbt deduplication error

  3. 3

    error while running sbt assembly : sbt deduplication error

  4. 4

    Slick 3.1.1 deduplication errors with sbt-assembly

  5. 5

    Slick 3.1.1 deduplication errors with sbt-assembly

  6. 6

    SBT Scala Assembly Plugin

  7. 7

    Apache Spark, Error on sbt/assembly

  8. 8

    Deduplication in build.sbt

  9. 9

    Error with maven build with assembly plugin

  10. 10

    How to exclude transitive dependency in Sbt ( in context of assembly plugin )?

  11. 11

    sbt assembly plugin includes "provided" libraries and it's lineage

  12. 12

    sbt assembly error - deduplicate: different file contents found in the following

  13. 13

    sbt assembly error - deduplicate: different file contents found in the following

  14. 14

    Should sbt-assembly perform a "maven-shade-plugin"-like relocation of classes?

  15. 15

    SBT assembly jar exclusion

  16. 16

    sbt assembly command not found

  17. 17

    trying to use sbt assembly

  18. 18

    maven-assembly-plugin gives java heap space error

  19. 19

    Specflow plugin : Generation error: Missing [assembly:GeneratorPlugin] attribute in

  20. 20

    Running an uber jar from sbt assembly results in error: Could not find or load main class

  21. 21

    "./sbt/sbt assembly" errors "Not a valid command: assembly" for Apache Spark project

  22. 22

    Using a custom sbt plugin

  23. 23

    SBT Plugin that adds Plugins

  24. 24

    Using a custom sbt plugin

  25. 25

    sbt publish assembly jar with a pom

  26. 26

    Increase memory in sbt-assembly

  27. 27

    SBT build file not recognizing "assembly"

  28. 28

    SBT Assembly not working (not a valid command)

  29. 29

    sbt-assembly not including dependencies

HotTag

Archive