我有一个具有多个依赖项的项目,最终导致依赖于以下各项(我从sbt-dependency-graph plugin中获得了这些依赖项):
commons-beanutils:commons-beanutils:1.7.0
commons-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
好像对两个工件都应用了阴影处理。如何遮蔽特定的伪影?