-
Notifications
You must be signed in to change notification settings - Fork 96
[MSHADE-156] shade plugin is transforming also strings that are not supposed to be transformed #518
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingpriority:majorMajor loss of functionMajor loss of function
Description
Neeme Praks opened MSHADE-156 and commented
I'm shading several third party libraries into a single JAR. In the context of this issue, there are two important libraries:
- com.nothome:javaxdelta:2.0.1 - this library is in "at.spardat.xma.xdelta" package.
- ch.qos.logback:logback-classic:1.0.11 - in this library, in class ch.qos.logback.classic.spi.StackTraceElementProxy, there is a method to convert stack trace elements into strings:
public String getSTEAsString() {
if (steAsString == null) {
steAsString = "at " + ste.toString();
}
return steAsString;
}
I use "org.myorgname.appname.shaded" package for shading.
During shading, the constant "at " is replaced with "org.myorgname.appname.shaded.at" -- shade plugin thinks that the "at" in the beginning of that string is a package name and shades it.
This results in an unfortunate side-effect: all logged stack traces now look like this:
Caused by: java.util.zip.ZipException: error in opening zip file
org.myorgname.appname.shaded.at java.util.zip.ZipFile.open(Native Method) ~[na:1.6.0_19]
org.myorgname.appname.shaded.at java.util.zip.ZipFile.<init>(ZipFile.java:114) ~[na:1.6.0_19]
org.myorgname.appname.shaded.at java.util.zip.ZipFile.<init>(ZipFile.java:131) ~[na:1.6.0_19]
Possible fixes:
- instead of just checking the first part of the package (at), check for the full package (at.spardat.xma.xdelta).
- allow to configure shade plugin to ignore certain string constants in certain classes (this would solve also some other issues we have with shade plugin being too eager).
- both of the above.
Affects: 2.1
Issue Links:
- SLING-8092 Relocation in Content Extension too bold
("causes") - FLINK-13044 Shading of AWS SDK in flink-s3-fs-hadoop results in ClassNotFoundExceptions
("breaks")
Remote Links:
9 votes, 15 watchers
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpriority:majorMajor loss of functionMajor loss of function