Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [transformer-dev] Custom rename rule for javax package not taking effect when transforming shaded artifact using transformer-maven-plugin
  • From: BJ Hargrave <hargrave@xxxxxxxxxx>
  • Date: Wed, 29 Oct 2025 14:58:29 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=us.ibm.com; dmarc=pass action=none header.from=us.ibm.com; dkim=pass header.d=us.ibm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=y+waMkT5QjkK+UuCHI9NDGBxmiW38nY4YWch24hu+zs=; b=H/bLIGceUqQe8i6a1B2+uiIgn/5rBTAs6sRAA5ovi+Thjaarvd+4XDMckI0YTExzwE/4OwhWuKjXZ92RktXlJi5NyAbDZXMZi1bt7GBZmQUoqnPgUJ8o6JMX/pAHZGCuO/jYLdZHUrVoFx648V3awXDfpf28NbQDeG2zNoDWXpOt1QdlR7exUENbw7FhfyjwTvFMZ1N+EgK1L7Tz+JmFAzTIZLYW0BFe2icCqA9ZsKpDx59wfc4tXazhobwogkyC8g5bLBBrZkw0tLtymhZZ31A1CnVr0lfAu1HuOIuI3l+WrdOtq5NXwTvf+rSWmizPwGEo34ErS2VoUeBQ0JZWAQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yEFeW46Tp0Fy/uOGQ7hRii1iDuiz+qW/UHrU8lLPCTMQq7aGnt9kzFydTowiYkPGVovpZ0E1PjR6wM2B4e6ZU1chyunbVUVCbex5wSa/Fx2R87fJiNWDNvK8hWT5UEutu4cFzi3RAjUiIYEaj8aHLKstZNaYyiPNl9DdUco1Ik7cnya0uCNrbEX44AOTWvYiOohX+6oyPWIrpGMXUdsfaT6SutMviVf8XeyzDaTNT4bldJwCO97haH/31e71BLoZjVu6gOAEcmA+sIvkV0WoO1vUPHbluudJnOhLFpHWWEEH7+EgUTFbbs1q0dLrHtFw9VvdthgGoO7Ol2D+flKvOA==
  • Delivered-to: transformer-dev@xxxxxxxxxxx
  • List-archive: <https://dev.eclipse.org/mailman/private/transformer-dev/>
  • List-help: <mailto:transformer-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://dev.eclipse.org/mailman/listinfo/transformer-dev>, <mailto:transformer-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://dev.eclipse.org/mailman/options/transformer-dev>, <mailto:transformer-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHcSNzMoGOrzlM+kkCwbOiUuXV3ZbTZNWo3
  • Thread-topic: [EXTERNAL] [transformer-dev] Custom rename rule for javax package not taking effect when transforming shaded artifact using transformer-maven-plugin

I am a little rusty on the details, but I think it should work. See the test case https://github.com/eclipse-transformer/transformer/tree/main/maven-plugins/transformer-maven-plugin/src/it/shading which shades classes compiled from source. 

-- 


BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
Open Source Development // mobile: +1 386 848 3788
hargrave@xxxxxxxxxx

 

 

 

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!

Back to the top