【问题标题】:deduplicating commons-validator - sbt assembly去重 commons-validator - sbt 程序集
【发布时间】:2015-08-14 22:59:04
【问题描述】:

下面是commons-validator的依赖图

在我的构建中我有

"commons-validator" % "commons-validator" % "1.4.1"

下面是commons-validator的依赖图

[info]   +-commons-validator:commons-validator:1.4.1
[info]   | +-commons-beanutils:commons-beanutils:1.8.3
[info]   | | +-commons-logging:commons-logging:1.1.1 (evicted by: 1.2)
[info]   | | +-commons-logging:commons-logging:1.2
[info]   | |
[info]   | +-commons-collections:commons-collections:3.2.1
[info]   | +-commons-digester:commons-digester:1.8.1
[info]   | +-commons-logging:commons-logging:1.2

当我运行 sbt 程序集来构建一个独立的 jar 时,我得到了

[trace] Stack trace suppressed: run last *:assembly for the full output.
[error] (*:assembly) deduplicate: different file contents found in the following:
[error] /Users/ali/.ivy2/cache/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.3.jar:org/apache/commons/collections/ArrayStack.class
[error] /Users/ali/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:org/apache/commons/collections/ArrayStack.class
[error] deduplicate: different file contents found in the following:
[error] /Users/ali/.ivy2/cache/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.3.jar:org/apache/commons/collections/Buffer.class
[error] /Users/ali/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:org/apache/commons/collections/Buffer.class
[error] deduplicate: different file contents found in the following:
[error] /Users/ali/.ivy2/cache/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.3.jar:org/apache/commons/collections/BufferUnderflowException.class
[error] /Users/ali/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:org/apache/commons/collections/BufferUnderflowException.class
[error] deduplicate: different file contents found in the following:
[error] /Users/ali/.ivy2/cache/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.3.jar:org/apache/commons/collections/FastHashMap$1.class
[error] /Users/ali/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:org/apache/commons/collections/FastHashMap$1.class
[error] deduplicate: different file contents found in the following:
[error] /Users/ali/.ivy2/cache/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.3.jar:org/apache/commons/collections/FastHashMap$CollectionView$CollectionViewIterator.class
[error] /Users/ali/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:org/apache/commons/collections/FastHashMap$CollectionView$CollectionViewIterator.class
[error] deduplicate: different file contents found in the following:
[error] /Users/ali/.ivy2/cache/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.3.jar:org/apache/commons/collections/FastHashMap$CollectionView.class
[error] /Users/ali/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:org/apache/commons/collections/FastHashMap$CollectionView.class
[error] deduplicate: different file contents found in the following:
[error] /Users/ali/.ivy2/cache/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.3.jar:org/apache/commons/collections/FastHashMap$EntrySet.class
[error] /Users/ali/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:org/apache/commons/collections/FastHashMap$EntrySet.class
[error] deduplicate: different file contents found in the following:
[error] /Users/ali/.ivy2/cache/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.3.jar:org/apache/commons/collections/FastHashMap$KeySet.class
[error] /Users/ali/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:org/apache/commons/collections/FastHashMap$KeySet.class
[error] deduplicate: different file contents found in the following:
[error] /Users/ali/.ivy2/cache/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.3.jar:org/apache/commons/collections/FastHashMap$Values.class
[error] /Users/ali/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:org/apache/commons/collections/FastHashMap$Values.class
[error] deduplicate: different file contents found in the following:
[error] /Users/ali/.ivy2/cache/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.3.jar:org/apache/commons/collections/FastHashMap.class
[error] /Users/ali/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:org/apache/commons/collections/FastHashMap.class

关于如何解决此问题的任何想法?

【问题讨论】:

    标签: scala maven sbt


    【解决方案1】:

    可能对其他人有用,

     ("commons-validator" % "commons-validator" % "1.4.1").exclude("commons-beanutils","commons-beanutils"),
      "commons-beanutils" % "commons-beanutils-bean-collections" % "1.8.3"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-16
      • 2023-03-30
      • 2016-09-02
      • 1970-01-01
      • 2014-09-21
      • 2013-12-06
      • 2017-03-15
      • 1970-01-01
      相关资源
      最近更新 更多