sbt assembly编译打包时报: deduplicate: different file contents found in the following:

参考文章:

http://blog.csdn.net/oopsoom/article/details/41318599

《sbt assembly编译打包时报: deduplicate: different file contents found in the following:》

[error] (marathon/*:assembly) deduplicate:different file contents found in the following:

[error] META-INF/aop.xml

[error]/root/.coursier/cache/v1/https/repo1.maven.org/maven2/io/kamon/kamon-core_2.11/0.6.7/kamon-core_2.11-0.6.7.jar:META-INF/aop.xml

[error]/root/.coursier/cache/v1/https/repo1.maven.org/maven2/io/kamon/kamon-scala_2.11/0.6.7/kamon-scala_2.11-0.6.7.jar:META-INF/aop.xml

[error] deduplicate: different filecontents found in the following:

[error]/root/.coursier/cache/v1/https/repo1.maven.org/maven2/io/netty/netty-handler/4.0.43.Final/netty-handler-4.0.43.Final.jar:META-INF/io.netty.versions.properties

[error]/root/.coursier/cache/v1/https/repo1.maven.org/maven2/io/netty/netty-common/4.0.43.Final/netty-common-4.0.43.Final.jar:META-INF/io.netty.versions.properties

[error]/root/.coursier/cache/v1/https/repo1.maven.org/maven2/io/netty/netty-buffer/4.0.43.Final/netty-buffer-4.0.43.Final.jar:META-INF/io.netty.versions.properties

[error]/root/.coursier/cache/v1/https/repo1.maven.org/maven2/io/netty/netty-codec-http/4.0.43.Final/netty-codec-http-4.0.43.Final.jar:META-INF/io.netty.versions.properties

[error]/root/.coursier/cache/v1/https/repo1.maven.org/maven2/io/netty/netty-transport/4.0.43.Final/netty-transport-4.0.43.Final.jar:META-INF/io.netty.versions.properties

[error]/root/.coursier/cache/v1/https/repo1.maven.org/maven2/io/netty/netty-codec/4.0.43.Final/netty-codec-4.0.43.Final.jar:META-INF/io.netty.versions.properties


红色部分是冲突文件


解决措施:

    在marathon源码的根目录下

    在build.sbt文件或者assembly.sbt文件里添加以下内容:

《sbt assembly编译打包时报: deduplicate: different file contents found in the following:》

    根据上面报的异常,因此,这里添加了两项内容。

    然后,重新运行

#sbt clean compile assembly

在运行过程中,会抛一个警告:

《sbt assembly编译打包时报: deduplicate: different file contents found in the following:》

不建议使用mergeStrategy关键字了

最终打包成功:

《sbt assembly编译打包时报: deduplicate: different file contents found in the following:》

 、

本文转自故新51CTO博客,原文链接:http://blog.51cto.com/xingej/1956036 ,如需转载请自行联系原作者

点赞