Skip to content

Commit

Permalink
[Io7UetI2] Fix log4j dependency conflict.
Browse files Browse the repository at this point in the history
Also improve error with cause.

[Io7UetI2] Fix log4j conflict
  • Loading branch information
Lojjs committed Sep 30, 2024
1 parent 2fb26c5 commit 491cde9
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/apoc/util/MissingDependencyException.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Created by larusba on 5/18/17.
*/
public class MissingDependencyException extends RuntimeException {
public MissingDependencyException(String message) {
super(message);
public MissingDependencyException(String message, Throwable cause) {
super(message, cause);
}
}
18 changes: 14 additions & 4 deletions extra-dependencies/xls/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,21 @@ jar {
}

dependencies {
implementation group: 'org.apache.poi', name: 'poi', version: '5.3.0'
implementation group: 'org.apache.poi', name: 'poi-ooxml-lite', version: '5.3.0'
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '5.3.0' , {
exclude group: 'org.apache.commons', module: 'commons-compress'
// Make sure no transitive dependencies are included together with apache.poi

compileOnly "org.apache.poi:poi:5.3.0", {
exclude group: '*'
}
testImplementation "org.apache.poi:poi:5.3.0", {
exclude group: '*'
}
compileOnly "org.apache.poi:poi-ooxml:5.3.0", {
exclude group: '*'
}
testImplementation "org.apache.poi:poi-ooxml:5.3.0", {
exclude group: '*'
}

implementation group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '5.0.2'
implementation group: 'com.github.virtuald', name: 'curvesapi', version: '1.06'
implementation group: 'org.apache.commons', name: 'commons-collections4', version: '4.4'
Expand Down
18 changes: 14 additions & 4 deletions full/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,20 @@ dependencies {
// compileOnly "org.antlr:antlr4-runtime:4.7.2"
// testCompile "org.antlr:antlr4-runtime:4.7.2"

compileOnly "org.apache.poi:poi:5.3.0"
testImplementation "org.apache.poi:poi:5.3.0"
compileOnly "org.apache.poi:poi-ooxml:5.3.0"
testImplementation "org.apache.poi:poi-ooxml:5.3.0"
// Make sure no transitive dependencies are included together with apache.poi

compileOnly "org.apache.poi:poi:5.3.0", {
exclude group: '*'
}
testImplementation "org.apache.poi:poi:5.3.0", {
exclude group: '*'
}
compileOnly "org.apache.poi:poi-ooxml:5.3.0", {
exclude group: '*'
}
testImplementation "org.apache.poi:poi-ooxml:5.3.0", {
exclude group: '*'
}

implementation 'org.jsoup:jsoup:1.15.3'

Expand Down
2 changes: 1 addition & 1 deletion full/src/main/java/apoc/export/xls/ExportXls.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private Stream<ProgressInfo> exportXls(
try {
return ExportXlsHandler.getProgressInfoStream(fileName, source, data, configMap, apocConfig, db);
} catch (NoClassDefFoundError e) {
throw new MissingDependencyException(XLS_MISSING_DEPS_ERROR);
throw new MissingDependencyException(XLS_MISSING_DEPS_ERROR, e);
}
}
}

0 comments on commit 491cde9

Please sign in to comment.