[ 
https://issues.apache.org/jira/browse/MSHADE-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17923147#comment-17923147
 ] 

ASF GitHub Bot commented on MSHADE-156:
---------------------------------------

andclt opened a new pull request, #249:
URL: https://github.com/apache/maven-shade-plugin/pull/249

   ## Notes
   
   Jira issue: [MSHADE-156](https://issues.apache.org/jira/browse/MSHADE-156)
   
   Add the option to skip relocating string literals. Currently this is not 
possible and the only available solution is to create a "fake" relocation 
pattern to prevent such behavior, 
[example](https://github.com/aws/aws-lambda-java-libs/pull/410).
   This change adds a new property `skipStringLiteral` which still relocates 
the prefix instances but not the string literals.
   
   ## Testing
   
   ```
   mvn clean verify
   
   Results:
   [INFO] Tests run: 72, Failures: 0, Errors: 0, Skipped: 0
   ```
   
   ---
   
   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
    - [x] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MSHADE) filed 
          for the change (usually before you start working on it).  Trivial 
changes like typos do not 
          require a JIRA issue.  Your pull request should address just this 
issue, without 
          pulling in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line 
and body.
    - [x] Format the pull request title like `[MSHADE-XXX] - Fixes bug in 
ApproximateQuantiles`,
          where you replace `MSHADE-XXX` with the appropriate JIRA issue. Best 
practice
          is to use the JIRA issue title in the pull request title and in the 
first line of the 
          commit message.
    - [x] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
    - [x] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will 
          be performed on your pull request automatically.
    - [x] You have run the integration tests successfully (`mvn -Prun-its clean 
verify`).
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under 
   the [Apache License Version 2.0, January 
2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x] I hereby declare this contribution to be licenced under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [ ] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   




> shade plugin is transforming also strings that are not supposed to be 
> transformed
> ---------------------------------------------------------------------------------
>
>                 Key: MSHADE-156
>                 URL: https://issues.apache.org/jira/browse/MSHADE-156
>             Project: Maven Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Neeme Praks
>            Priority: Major
>             Fix For: backlog
>
>
> I'm shading several third party libraries into a single JAR. In the context 
> of this issue, there are two important libraries:
> 1. com.nothome:javaxdelta:2.0.1 - this library is in "at.spardat.xma.xdelta" 
> package.
> 2. 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:
> {code}
>   public String getSTEAsString() {
>     if (steAsString == null) {
>       steAsString = "at " + ste.toString();
>     }
>     return steAsString;
>   }
> {code}
> 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:
> {noformat}
> 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]
> {noformat}
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to