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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sbt assembly编译打包时报: deduplicate: different file contents found in the following:相关的知识,希望对你有一定的参考价值。

参考文章:

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

技术分享

[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 clean compile assembly

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

技术分享

不建议使用mergeStrategy关键字了

最终打包成功:

技术分享

 


本文出自 “XEJ分布式工作室” 博客,请务必保留此出处http://xingej.blog.51cto.com/7912529/1956036

以上是关于sbt assembly编译打包时报: deduplicate: different file contents found in the following:的主要内容,如果未能解决你的问题,请参考以下文章

问题:sbt打包出错--Spark打包编译出错

设置 sbt 程序集 v0.14.2 的问题

编译打包工具sbt的镜像设置

使用 SBT 编译测试并将它们打包以便稍后运行

使用 SBT 将编译后的 Scala 文件打包到 jar 中

SBT为超级罐编译