yupiik / maven-shade-transformers

Extensions to use with Apache Maven Shade.
https://www.yupiik.com
Apache License 2.0
9 stars 3 forks source link

PrimeFaces: Some not being transformed correctly #8

Closed melloware closed 1 year ago

melloware commented 1 year ago

Hey @rmannibucau its me again.

We had this reported in Primefaces: https://github.com/primefaces/primefaces/issues/9657

It was not transforming javax.el to jakarta.el even though our pom.xml has the correct transforms.

https://github.com/primefaces/primefaces/blob/ae87e9e33205f8a0d108780963544fed61f86a34/primefaces/pom.xml#L938-L1168

However if I moved this line to the bottom of the list it then started shading javax.el correctly to jakarta.el

<relocation>
       <pattern>/javax.faces</pattern>
       <shadedPattern>/jakarta.faces</shadedPattern>
       <rawString>true</rawString>
</relocation>

Previously that had been declared right above javax.el like this..

<relocation>
       <pattern>/javax.faces</pattern>
       <shadedPattern>/jakarta.faces</shadedPattern>
       <rawString>true</rawString>
</relocation>
<relocation>
       <pattern>javax.el</pattern>
        <shadedPattern>jakarta.el</shadedPattern>
</relocation>

I am not sure if that gives you a hint or not but I can't explain why that fixed it. Now we are down to 2 classes left not being shaded and we have no idea why.

PrimeApplicationContext.java (is not shading javax.validation): https://github.com/primefaces/primefaces/blob/master/primefaces/src/main/java/org/primefaces/context/PrimeApplicationContext.java

JpaLazyDataModel (is not shading javax.persistence): https://github.com/primefaces/primefaces/blob/master/primefaces/src/main/java/org/primefaces/model/JpaLazyDataModel.java

And we have no idea why or where to begin debugging?

rmannibucau commented 1 year ago

Hi @melloware ,

The relocation is a chain so order matters so sounds very possible and unrelated to this project technically (could be to maven shade to enable a kind of routing relocation - case vs for)