首页 > 解决方案 > 斯坦福 CoreNLP 的依赖问题

问题描述

我正在尝试在我的 Android 应用程序中使用斯坦福 CoreNLP,所以我将其包含在我的build.gradle

implementation 'edu.stanford.nlp:stanford-corenlp:4.0.0'

然后我在 Kotlin 中创建了一个Pipeline类,代码如下:

object Pipeline {
    private var properties: Properties? = null
    private const val propertiesName = "pos"
    private var stanfordCoreNLP: StanfordCoreNLP? = null

    val pipeline: StanfordCoreNLP
        get() {
            if (stanfordCoreNLP == null) {
                stanfordCoreNLP = StanfordCoreNLP(properties)
            }
            return stanfordCoreNLP as StanfordCoreNLP
        }

    init {
        properties = Properties()
        properties!!.setProperty("annotators", propertiesName)
    }
}

为了使用该Pipeline课程,我将其包含在我的MainActivity

stanfordCoreNLP = Pipeline.pipeline
coreDocument = CoreDocument(text)
stanfordCoreNLP.annotate(coreDocument)
coreLabelList = coreDocument.tokens()
for (coreLabel: CoreLabel in coreLabelList) {
    val pos: String =
        coreLabel.get(CoreAnnotations.PartOfSpeechAnnotation::class.java)
    if (pos == "NN") {
        print(coreLabel.originalText() + " " + pos + ", ")
    }
}

我在活动的顶部创建了stanfordCoreNLP,coreDocument和,如下所示:coreLabelList

private lateinit var stanfordCoreNLP: StanfordCoreNLP
private lateinit var coreDocument: CoreDocument
private lateinit var coreLabelList: List<CoreLabel>

当我尝试构建我的应用程序时,它崩溃了。这是我在控制台中得到的:

Duplicate class com.sun.xml.bind.Locatable found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.Messages found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.Util found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.WhiteSpaceProcessor found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.annotation.OverrideAnnotationOf found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.annotation.XmlIsSet found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.annotation.XmlLocation found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.api.ErrorListener found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.api.impl.NameConverter found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.api.impl.NameConverter$1 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.api.impl.NameConverter$2 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.api.impl.NameConverter$Standard found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.api.impl.NameUtil found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.marshaller.CharacterEscapeHandler found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.marshaller.DataWriter found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.marshaller.DumbEscapeHandler found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.marshaller.Messages found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.marshaller.MinimumEscapeHandler found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.marshaller.NoEscapeHandler found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.marshaller.SAX2DOMEx found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.marshaller.XMLWriter found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.unmarshaller.DOMScanner found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.unmarshaller.InfosetScanner found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.util.SecureLoader found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.util.SecureLoader$1 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.util.SecureLoader$2 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.util.SecureLoader$3 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.util.Which found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.ClassFactory found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.ClassFactory$1 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.ClassFactory$2 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.Messages found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.TODO found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.WellKnownNamespace found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.annotation.AnnotationReader found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.annotation.AnnotationSource found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.annotation.Locatable found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.Adapter found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.ArrayInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.AttributePropertyInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.BuiltinLeafInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.ClassInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.Element found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.ElementInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.ElementPropertyInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.EnumConstant found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.EnumLeafInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.ErrorHandler found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.ID found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.LeafInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.MapPropertyInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.MaybeElement found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.NonElement found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.NonElementRef found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.PropertyInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.PropertyKind found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.Ref found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.ReferencePropertyInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.RegistryInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.TypeInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.TypeInfoSet found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.TypeRef found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.ValuePropertyInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.WildcardMode found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.WildcardTypeInfo found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.core.package-info found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.impl.ModelBuilderI found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.GenericArrayTypeImpl found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.Navigator found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.ParameterizedTypeImpl found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.ReflectionNavigator found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.ReflectionNavigator$1 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.ReflectionNavigator$10 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.ReflectionNavigator$2 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.ReflectionNavigator$3 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.ReflectionNavigator$4 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.ReflectionNavigator$5 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.ReflectionNavigator$6 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.ReflectionNavigator$7 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.ReflectionNavigator$8 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.ReflectionNavigator$9 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.ReflectionNavigator$BinderArg found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.SecureLoader found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.SecureLoader$1 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.SecureLoader$2 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.SecureLoader$3 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.TypeVisitor found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.nav.WildcardTypeImpl found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.model.util.ArrayInfoUtil found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.runtime.IllegalAnnotationException found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.runtime.Location found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.runtime.RuntimeUtil found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.runtime.RuntimeUtil$ToStringAdapter found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.runtime.SwaRefAdapterMarker found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.runtime.unmarshaller.LocatorEx found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.runtime.unmarshaller.LocatorEx$Snapshot found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.schemagen.episode.Bindings found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.schemagen.episode.Klass found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.schemagen.episode.Package found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.schemagen.episode.SchemaBindings found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.schemagen.episode.package-info found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.util.EditDistance found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.util.FlattenIterator found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.util.XmlFactory found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)
Duplicate class com.sun.xml.bind.v2.util.XmlFactory$1 found in modules jetified-jaxb-core-2.3.0.1.jar (com.sun.xml.bind:jaxb-core:2.3.0.1) and jetified-jaxb-impl-2.4.0-b180830.0438.jar (com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438)

Go to the documentation to learn how to Fix dependency resolution errors.

我该如何解决?

标签: androidkotlinbuild.gradlestanford-nlp

解决方案


我也留下了一些评论,但基本上 CoreNLP 会带来与项目冲突的依赖项。我做了一个实验,能够运行一个tokenize,ssplit,pos没有任何 CoreNLP 依赖项的 CoreNLP 管道。因此,如果您只是在运行管道,您应该能够摆脱 CoreNLP 的所有依赖项,这可能有助于解决这个问题。


推荐阅读