From: transformer-dev <transformer-dev-bounces@xxxxxxxxxxx> on behalf of jan luehe via transformer-dev <transformer-dev@xxxxxxxxxxx>
Date: Wednesday, October 29, 2025 at 10:03
To: transformer-dev@xxxxxxxxxxx <transformer-dev@xxxxxxxxxxx>
Cc: jan luehe <janluehe@xxxxxxxxx>
Subject: [EXTERNAL] [transformer-dev] Custom rename rule for javax package not taking effect when transforming shaded artifact using transformer-maven-plugin
This Message Is From an External Sender
This message came from outside your organization.
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.
Could you please help me understand what I'm missing?
Thanks!