Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

clustering example fails with assembly sbt command #269

Open
bwbecker opened this issue Aug 9, 2022 · 1 comment
Open

clustering example fails with assembly sbt command #269

bwbecker opened this issue Aug 9, 2022 · 1 comment

Comments

@bwbecker
Copy link

bwbecker commented Aug 9, 2022

I pulled the cluster example project from https://developer.lightbend.com/start/?group=akka&project=akka-samples-cluster-scala

With no other changes, I did sbt assembly to get a fat jar file to run without all the scala infrastructure. It gave

[error] 1 error was encountered during merge
[error] stack trace is suppressed; run last assembly for the full output
[error] (assembly) deduplicate: different file contents found in the following:
[error] /Users/bwbecker/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.11.4/jackson-core-2.11.4.jar:module-info.class
[error] /Users/bwbecker/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.11.4/jackson-annotations-2.11.4.jar:module-info.class
[error] /Users/bwbecker/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.11.4/jackson-databind-2.11.4.jar:module-info.class
[error] /Users/bwbecker/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.11.4/jackson-datatype-jdk8-2.11.4.jar:module-info.class
[error] /Users/bwbecker/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.11.4/jackson-datatype-jsr310-2.11.4.jar:module-info.class
[error] /Users/bwbecker/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-parameter-names/2.11.4/jackson-module-parameter-names-2.11.4.jar:module-info.class
[error] /Users/bwbecker/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.11.4/jackson-dataformat-cbor-2.11.4.jar:module-info.class
[error] /Users/bwbecker/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-paranamer/2.11.4/jackson-module-paranamer-2.11.4.jar:module-info.class
[error] Total time: 6 s, completed Aug. 9, 2022, 10:39:48 a.m.

Adding the following to the build.sbt file fixed the issue:

    // See https://stackoverflow.com/questions/64858397/sbt-assembly-deduplicate-different-file-contents-found-in-the-following-jackso/73293137#73293137
    assembly / assemblyMergeStrategy := {
      case "module-info.class" => MergeStrategy.discard
      case x =>
        val oldStrategy = (assembly / assemblyMergeStrategy).value
        oldStrategy(x)
    }
@bwbecker
Copy link
Author

bwbecker commented Aug 9, 2022

In preparing a pull request, I discovered that the above does not work. It generates the jar file but when trying to run it, java complains that the manifest is missing. Tried to fix with

//case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.concat

but that gave another duplicate error.

I don't know how to resolve it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant