2017-05-18 60 views
1

我試圖在使用sbt-assembly的微服務級別綁定Lagom中的jar(使用Play)。 Play中的傳遞依賴性是sbt-assembly's GitHub README上列出的已知問題。每對README的指示,我嵌入我的build.sbtLagom/Play + sbt-assembly:「重複數據刪除:在以下內容中找到不同的文件內容」

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 

回答

0

the answer我只是發佈到「如何從斯卡拉/ SBT/SLF4J項目排除共享記錄?」:

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

這應該對所有庫的依賴排除共享記錄子項目。