We are trying to transpile a shaded jar file using the org.eclipse.transformer:transformer-maven-plugin.
We've configured the plugin's artifact configuration parameter as follows:
<artifact>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>2.5.1-sfdc</version>
<classifier>shaded</classifier>
</artifact>
We have no control over the dependencies included in the shaded (uber) jar. For example, the shaded (uber) jar bundles javax.validation. To avoid conflicts with the "standard" jakarta.validation package that is present on the class path, we want to instruct the plugin to transform javax.validation to a custom package, let's call it foo.bar.jakarta.validation. To that effect, we have replaced
<rules>
<jakartaDefaults>true</jakartaDefaults>
</rules>
with:
<rules>
<renames>
<rename>src/main/resources/jakarta-renames.properties</rename>
</renames>
<selections>
<selection>src/main/resources/jakarta-selection.properties</selection>
/selections>
<versions>
<version>src/main/resources/jakarta-versions.properties</version>
</versions>
<bundles>
<bundle>src/main/resources/jakarta-bundles.properties</bundle>
</bundles>
<directs>
<direct>src/main/resources/jakarta-direct.properties</direct>
</directs>
<texts>
<text>src/main/resources/jakarta-text-master.properties</text>
</texts>
</rules>
where our jakarta-renames.properties contains the following package renames:
javax.validation=foo.bar.jakarta.validation
javax.validation.valueextraction=foo.bar.jakarta.validation.valueextraction
...
When I execute the plugin in debug mode, I do see these above package renames getting picked up:
[INFO] Properties [ RULES_RENAMES ] URL [ file:/Users/jluehe/Desktop/ws/gwt-user-transpile/src/main/resources/jakarta-renames.properties ]
...
[DEBUG] [ javax.validation ]: [ foo.bar.jakarta.validation ]
[DEBUG] [ javax.validation.valueextraction ]: [ foo.bar.jakarta.validation.valueextraction ]
...
However, the transformed jar file contains jakarta.validation classes, when I was expecting to see classes in the foo.bar.jakarta.validation package.