Skip to content

Commit 491cde9

Browse files
committed
[Io7UetI2] Fix log4j dependency conflict.
Also improve error with cause. [Io7UetI2] Fix log4j conflict
1 parent 2fb26c5 commit 491cde9

File tree

4 files changed

+31
-11
lines changed

4 files changed

+31
-11
lines changed

core/src/main/java/apoc/util/MissingDependencyException.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* Created by larusba on 5/18/17.
2323
*/
2424
public class MissingDependencyException extends RuntimeException {
25-
public MissingDependencyException(String message) {
26-
super(message);
25+
public MissingDependencyException(String message, Throwable cause) {
26+
super(message, cause);
2727
}
2828
}

extra-dependencies/xls/build.gradle

+14-4
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,21 @@ jar {
2020
}
2121

2222
dependencies {
23-
implementation group: 'org.apache.poi', name: 'poi', version: '5.3.0'
24-
implementation group: 'org.apache.poi', name: 'poi-ooxml-lite', version: '5.3.0'
25-
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '5.3.0' , {
26-
exclude group: 'org.apache.commons', module: 'commons-compress'
23+
// Make sure no transitive dependencies are included together with apache.poi
24+
25+
compileOnly "org.apache.poi:poi:5.3.0", {
26+
exclude group: '*'
27+
}
28+
testImplementation "org.apache.poi:poi:5.3.0", {
29+
exclude group: '*'
30+
}
31+
compileOnly "org.apache.poi:poi-ooxml:5.3.0", {
32+
exclude group: '*'
2733
}
34+
testImplementation "org.apache.poi:poi-ooxml:5.3.0", {
35+
exclude group: '*'
36+
}
37+
2838
implementation group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '5.0.2'
2939
implementation group: 'com.github.virtuald', name: 'curvesapi', version: '1.06'
3040
implementation group: 'org.apache.commons', name: 'commons-collections4', version: '4.4'

full/build.gradle

+14-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,20 @@ dependencies {
6464
// compileOnly "org.antlr:antlr4-runtime:4.7.2"
6565
// testCompile "org.antlr:antlr4-runtime:4.7.2"
6666

67-
compileOnly "org.apache.poi:poi:5.3.0"
68-
testImplementation "org.apache.poi:poi:5.3.0"
69-
compileOnly "org.apache.poi:poi-ooxml:5.3.0"
70-
testImplementation "org.apache.poi:poi-ooxml:5.3.0"
67+
// Make sure no transitive dependencies are included together with apache.poi
68+
69+
compileOnly "org.apache.poi:poi:5.3.0", {
70+
exclude group: '*'
71+
}
72+
testImplementation "org.apache.poi:poi:5.3.0", {
73+
exclude group: '*'
74+
}
75+
compileOnly "org.apache.poi:poi-ooxml:5.3.0", {
76+
exclude group: '*'
77+
}
78+
testImplementation "org.apache.poi:poi-ooxml:5.3.0", {
79+
exclude group: '*'
80+
}
7181

7282
implementation 'org.jsoup:jsoup:1.15.3'
7383

full/src/main/java/apoc/export/xls/ExportXls.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private Stream<ProgressInfo> exportXls(
111111
try {
112112
return ExportXlsHandler.getProgressInfoStream(fileName, source, data, configMap, apocConfig, db);
113113
} catch (NoClassDefFoundError e) {
114-
throw new MissingDependencyException(XLS_MISSING_DEPS_ERROR);
114+
throw new MissingDependencyException(XLS_MISSING_DEPS_ERROR, e);
115115
}
116116
}
117117
}

0 commit comments

Comments
 (0)