我有幾個依賴一個項目,這最終導致 取決於以下(我得到了這些來自sbt-dependency-graph plugin):如何用sbt-assembly重複刪除beanutils依賴關係?
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.**" -> "[email protected]").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
彷彿被施加陰影處理到兩個文物。如何遮蔽特定的神器?
確實。刪除'.inAll'解決了這個問題。我誤解了文檔,但現在一切似乎都很清楚。非常感謝支持。 – ale64bit
@ ale64bit,你可以請一個工作'build.sbt'文件的片段。我有一個類似的問題,而取決於'org.apache.hadoop:hadoop-aws:2.7.3'。 – Interfector