JGit 导致开箱即用的重复类错误

问题描述 投票:0回答:0

Attempting to integrate JGit into an Android project and getting lots duplicate classes ERRORs all coming from JGit transitive dependency:

重复类检测显示等:

    - org/apache/sshd/common/util/closeable/SequentialCloseable.class is in [sshd-osgi-2.7.0.jar, sshd-common-2.7.0.jar]
    - org/apache/sshd/common/util/closeable/SimpleCloseable.class is in [sshd-osgi-2.7.0.jar, sshd-common-2.7.0.jar]
    - org/apache/sshd/common/util/functors/Int2IntFunction.class is in [sshd-osgi-2.7.0.jar, sshd-common-2.7.0.jar]
    - org/apache/sshd/common/util/functors/UnaryEquator.class is in [sshd-osgi-2.7.0.jar, sshd-common-2.7.0.jar]
    - org/apache/sshd/common/util/helper/LazyIterablesConcatenator$1.class is in [sshd-osgi-2.7.0.jar, sshd-common-2.7.0.jar]
    - org/apache/sshd/common/util/helper/LazyIterablesConcatenator.class is in [sshd-osgi-2.7.0.jar, sshd-common-2.7.0.jar]
    - org/apache/sshd/common/util/helper/LazyMatchingTypeIterable.class is in [sshd-osgi-2.7.0.jar, sshd-common-2.7.0.jar]
    - org/apache/sshd/common/util/helper/LazyMatchingTypeIterator.class is in [sshd-osgi-2.7.0.jar, sshd-common-2.7.0.jar]
    - org/apache/sshd/common/util/io/CloseableEmptyInputStream.class is in [sshd-osgi-2.7.0.jar, sshd-common-2.7.0.jar]

sshd-osgi-2.7.0.jar 和 sshd-common-2.7.0.jar 都来自

org.eclipse.jgit:org.eclipse.jgit.ssh.apache
在运行时显示在这里
gradle dependencies
:

    |    +--- org.eclipse.jgit:org.eclipse.jgit.ssh.apache:5.13.1.202206130422-r
    |    |    +--- org.eclipse.jgit:org.eclipse.jgit:5.13.1.202206130422-r (*)
    |    |    +--- org.apache.sshd:sshd-osgi:2.7.0
    |    |    |    +--- org.slf4j:slf4j-api:1.7.30
    |    |    |    \--- org.slf4j:jcl-over-slf4j:1.7.30
    |    |    |         \--- org.slf4j:slf4j-api:1.7.30
    |    |    +--- org.apache.sshd:sshd-sftp:2.7.0
    |    |    |    +--- org.apache.sshd:sshd-core:2.7.0
    |    |    |    |    +--- org.apache.sshd:sshd-common:2.7.0

我是不是遗漏了什么,或者这个相当常用的包实际上在其依赖项中有重复的类,这些类破坏了它在 Android 平台中开箱即用的使用??

java android gradle jgit
© www.soinside.com 2019 - 2024. All rights reserved.