sbt组装失败,因为找到了不同的文件内容 [英] sbt assembly fails due to different file contents found

查看:115
本文介绍了sbt组装失败,因为找到了不同的文件内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在GitLab中构建一个项目. 在gitlab-ci.yml中,我运行了sbt程序集并遇到了令人讨厌的异常.

I am trying to build a project in GitLab. In gitlab-ci.yml, I ran sbt assembly and encountered annoying exception.

[error] (soda/*:assembly) deduplicate: different file contents found in the following:
[error] /root/.ivy2/cache/io.netty/netty-buffer/jars/netty-buffer-4.0.42.Final.jar:META-INF/io.netty.versions.properties
[error] /root/.ivy2/cache/io.netty/netty-common/jars/netty-common-4.0.42.Final.jar:META-INF/io.netty.versions.properties
[error] /root/.ivy2/cache/io.netty/netty-codec-http/jars/netty-codec-http-4.0.42.Final.jar:META-INF/io.netty.versions.properties
[error] /root/.ivy2/cache/io.netty/netty-codec/jars/netty-codec-4.0.42.Final.jar:META-INF/io.netty.versions.properties
[error] /root/.ivy2/cache/io.netty/netty-transport/jars/netty-transport-4.0.42.Final.jar:META-INF/io.netty.versions.properties
[error] /root/.ivy2/cache/io.netty/netty-handler/jars/netty-handler-4.0.42.Final.jar:META-INF/io.netty.versions.properties
[error] /root/.ivy2/cache/io.netty/netty-transport-native-epoll/jars/netty-transport-native-epoll-4.0.42.Final-linux-x86_64.jar:META-INF/io.netty.versions.properties

我尝试按照 sbt-assembly:重复数据删除发现错误中的说明进行操作,似乎已经制定了MergeStrategy,但是仍然存在例外情况:

I tried to follow the instruction in sbt-assembly: deduplication found error, and it seems like the MergeStrategy is in place, however the exception remain:

[info] Merging files...
[warn] Merging 'NOTICE' with strategy 'rename'
[warn] Merging 'README' with strategy 'rename'
[warn] Merging 'META-INF/NOTICE.txt' with strategy 'rename'
[warn] Merging 'license/NOTICE' with strategy 'rename'
[warn] Merging 'META-INF/NOTICE' with strategy 'rename'
[warn] Merging 'org/xerial/snappy/native/README' with strategy 'rename'
[warn] Merging 'license' with strategy 'rename'
[warn] Merging 'license/LICENSE' with strategy 'rename'
[warn] Merging 'META-INF/license' with strategy 'rename'
[warn] Merging 'META-INF/LICENSE.txt' with strategy 'rename'
[warn] Merging 'LICENSE.txt' with strategy 'rename'
[warn] Merging 'META-INF/LICENSE' with strategy 'rename'
[warn] Merging 'LICENSE' with strategy 'rename'
[warn] Merging 'META-INF/DEPENDENCIES' with strategy 'discard'
[warn] Merging 'META-INF/INDEX.LIST' with strategy 'discard'
[warn] Merging 'META-INF/MANIFEST.MF' with strategy 'discard'

我也尝试更改sbt版本,但问题仍然存在.

I also tried to change the sbt version, but the problem stays.

任何有关如何解决此问题的帮助都将非常有用.

Any help with how can I resolve this issue will be great.

推荐答案

最终,我找到了解决此问题的方法. 由于它是一个play项目,因此我可以使用激活器将其包装并创建一个包. 我使用以下代码来创建程序包: wget https://downloads.typesafe.com /typesafe-activator/1.3.7/typesafe-activator-1.3.7.zip &&解压缩typesafe-activator-1.3.7.zip 1>/dev/null activator-dist-1.3.7/activator -Dsbt.log.noformat = true -java-home/usr/lib/jvm/java-1.8-openjdk程序包clean compile test dist

Eventually I found a workaround for this problem. Since its a play project, I could use activator to wrap it up and create a package. I used the following code in order to create the package: wget https://downloads.typesafe.com/typesafe-activator/1.3.7/typesafe-activator-1.3.7.zip && unzip typesafe-activator-1.3.7.zip 1> /dev/null activator-dist-1.3.7/activator -Dsbt.log.noformat=true -java-home /usr/lib/jvm/java-1.8-openjdk package clean compile test dist

这篇关于sbt组装失败,因为找到了不同的文件内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆