Почему jar не может найти org.xml.sax.driver для apache poi? - PullRequest
0 голосов
/ 15 мая 2019

Я собрал банку с этим следующим build.gradle.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
    }
}

apply plugin: 'com.github.johnrengelman.plugin-shadow'
apply plugin: 'java'
apply plugin: 'application'

group 'Main'
version '1.0'

sourceCompatibility = 1.8

repositories {
    jcenter()
}

dependencies {
    testCompile 'junit:junit:4.12'
}
mainClassName = "Indexer"

dependencies {
    compile 'org.apache.lucene:lucene-core:7.4.0'
    compile 'org.apache.lucene:lucene-queryparser:7.4.0'
    compile 'org.apache.lucene:lucene-analyzers-common:7.4.0'
    compile 'org.apache.lucene:lucene-backward-codecs:7.4.0'
    compile 'org.apache.poi:poi:3.9'
    compile 'org.apache.poi:poi-ooxml:3.9'

}

shadowJar {
    manifest {
        attributes 'Main-Class': 'Indexer'
    }
    mergeServiceFiles()
}

Запуск из IDE работает нормально (IntelliJ). После генерации jar с помощью команды shadowJar он показывает эту ошибку:

Warning: Caught exception attempting to use SAX to load a SAX XMLReader 
Warning: Exception was: shadow.org.xml.sax.SAXException: Can't create default XMLReader;
 is system property org.xml.sax.driver set?
Warning: I will print the stack trace then carry on using the default SAX parser
shadow.org.xml.sax.SAXException: Can't create default XMLReader; 
 is system property org.xml.sax.driver set?

Любая помощь будет оценена. Спасибо.

...