【发布时间】:2016-03-16 07:52:48
【问题描述】:
我有一个项目有几个依赖项,最终导致 取决于以下内容(我从sbt-dependency-graph plugin 得到这些):
commons-beanutils:commons-beanutils:1.7.0commons-beanutils:commons-beanutils-core:1.8.0
因此,当我尝试使用 sbt-assembly 构建胖 JAR 时,它会失败并出现重复数据删除错误:
[error] deduplicate: different file contents found in the following:
[error] /Users/someuser/.ivy2/cache/commons-beanutils/commons-beanutils/jars/someuser-beanutils-1.7.0.jar:org/apache/commons/beanutils/BasicDynaBean.class
[error] /Users/someuser/.ivy2/cache/commons-beanutils/commons-beanutils-core/jars/commons-beanutils-core-1.8.0.jar:org/apache/commons/beanutils/BasicDynaBean.class
由于我需要两个依赖项,因此我尝试使用以下规则对其中一个进行遮蔽:
ShadeRule.rename("org.apache.commons.beanutils.**" -> "shadedstuff.beanutils.@1").inLibrary("commons-beanutils" % "commons-beanutils" % "1.7.0").inAll
然后我收到以下错误:
[error] deduplicate: different file contents found in the following:
[error] /Users/someuser/.ivy2/cache/commons-beanutils/commons-beanutils/jars/someuser-beanutils-1.7.0.jar:shadedstuff/beanutils/BasicDynaBean.class
[error] /Users/someuser/.ivy2/cache/commons-beanutils/commons-beanutils-core/jars/commons-beanutils-core-1.8.0.jar:shadedstuff/beanutils/BasicDynaBean.class
好像着色过程应用于两个工件。如何为特定的工件着色?
【问题讨论】:
标签: dependencies sbt sbt-assembly maven-shade-plugin