Lagom / Play + sbt-assembly:"重复数据删除:在以下内容中找到不同的文件内容"

时间:2017-05-18 19:37:26

标签: scala sbt sbt-assembly

我试图使用sbt-assembly在微服务级别捆绑Lagom(使用Play)中的jar。 Play中的传递依赖性是sbt-assembly's GitHub README中列出的已知问题。根据自述文件中的说明,我将以下代码嵌入到build.sbt

libraryDependencies ~= { _ map {
  case m if m.organization == "com.typesafe.play" =>
    m.exclude("commons-logging", "commons-logging").
      exclude("com.typesafe.play", "sbt-link")
  case m => m
}}

我仍然看到如下错误。上面的代码实际上是否在build.sbt文件中?我该如何解决这个问题?

[error] /Users/zsm559/.ivy2/cache/io.netty/netty-codec-http/jars/netty-codec-http-4.0.41.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/zsm559/.ivy2/cache/io.netty/netty-codec/jars/netty-codec-4.0.41.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/zsm559/.ivy2/cache/io.netty/netty-transport/jars/netty-transport-4.0.41.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/zsm559/.ivy2/cache/io.netty/netty-buffer/jars/netty-buffer-4.0.41.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/zsm559/.ivy2/cache/io.netty/netty-common/jars/netty-common-4.0.41.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/zsm559/.ivy2/cache/io.netty/netty-handler/jars/netty-handler-4.0.41.Final.jar:META-INF/io.netty.versions.properties
[error] /Users/zsm559/.ivy2/cache/io.netty/netty-transport-native-epoll/jars/netty-transport-native-epoll-4.0.41.Final-linux-x86_64.jar:META-INF/io.netty.versions.properties
[error] deduplicate: different file contents found in the following:
[error] /Users/zsm559/.ivy2/cache/commons-logging/commons-logging/jars/commons-logging-1.1.3.jar:org/apache/commons/logging/Log.class
[error] /Users/zsm559/.ivy2/cache/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.7.21.jar:org/apache/commons/logging/Log.class
[error] deduplicate: different file contents found in the following:
[error] /Users/zsm559/.ivy2/cache/commons-logging/commons-logging/jars/commons-logging-1.1.3.jar:org/apache/commons/logging/LogConfigurationException.class
[error] /Users/zsm559/.ivy2/cache/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.7.21.jar:org/apache/commons/logging/LogConfigurationException.class
[error] deduplicate: different file contents found in the following:
[error] /Users/zsm559/.ivy2/cache/commons-logging/commons-logging/jars/commons-logging-1.1.3.jar:org/apache/commons/logging/LogFactory.class
[error] /Users/zsm559/.ivy2/cache/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.7.21.jar:org/apache/commons/logging/LogFactory.class
[error] deduplicate: different file contents found in the following:
[error] /Users/zsm559/.ivy2/cache/commons-logging/commons-logging/jars/commons-logging-1.1.3.jar:org/apache/commons/logging/impl/NoOpLog.class
[error] /Users/zsm559/.ivy2/cache/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.7.21.jar:org/apache/commons/logging/impl/NoOpLog.class
[error] deduplicate: different file contents found in the following:
[error] /Users/zsm559/.ivy2/cache/commons-logging/commons-logging/jars/commons-logging-1.1.3.jar:org/apache/commons/logging/impl/SimpleLog$1.class
[error] /Users/zsm559/.ivy2/cache/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.7.21.jar:org/apache/commons/logging/impl/SimpleLog$1.class
[error] deduplicate: different file contents found in the following:
[error] /Users/zsm559/.ivy2/cache/commons-logging/commons-logging/jars/commons-logging-1.1.3.jar:org/apache/commons/logging/impl/SimpleLog.class
[error] /Users/zsm559/.ivy2/cache/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.7.21.jar:org/apache/commons/logging/impl/SimpleLog.class
[error] deduplicate: different file contents found in the following:
[error] /Users/zsm559/.ivy2/cache/com.typesafe.play/play_2.11/jars/play_2.11-2.5.10.jar:play/reference-overrides.conf
[error] /Users/zsm559/.ivy2/cache/com.lightbend.lagom/lagom-cluster-core_2.11/jars/lagom-cluster-core_2.11-1.3.3.jar:play/reference-overrides.conf
[error] /Users/zsm559/.ivy2/cache/com.lightbend.lagom/lagom-persistence-cassandra-core_2.11/jars/lagom-persistence-cassandra-core_2.11-1.3.3.jar:play/reference-overrides.conf
[error] deduplicate: different file contents found in the following:
[error] /Users/zsm559/.ivy2/cache/com.lightbend.lagom/lagom-persistence-cassandra-core_2.11/jars/lagom-persistence-cassandra-core_2.11-1.3.3.jar:test-embedded-cassandra.yaml
[error] /Users/zsm559/.ivy2/cache/com.typesafe.akka/akka-persistence-cassandra_2.11/bundles/akka-persistence-cassandra_2.11-0.26.jar:test-embedded-cassandra.yaml

1 个答案:

答案 0 :(得分:1)

请参阅the answer我刚刚发布到'如何从scala / sbt / slf4j项目中排除公共日志记录?':

excludeDependencies += "commons-logging" % "commons-logging"

这应该从子项目的所有库依赖项中排除commons-logging。