Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manifest Class-Path header not transformed #573

Open
riswarichu opened this issue May 6, 2024 · 3 comments
Open

Manifest Class-Path header not transformed #573

riswarichu opened this issue May 6, 2024 · 3 comments

Comments

@riswarichu
Copy link

riswarichu commented May 6, 2024

With jakartaDefaults rules set to true the manifest of the jar is not changed. It still have references to javax

@bjhargrave
Copy link
Member

We are going to need a lot more details on the problem here to better understand the situation. Can you please provide a reproduction of the problem?

@riswarichu
Copy link
Author

riswarichu commented May 9, 2024

When I create a jar, manifest is created as below

Manifest-Version: 1.0
Build-Jdk-Spec: 11
Class-Path: javax.transaction-api.jar
Implementation-Title: richu
Implementation-Version: 0.0.1-SNAPSHOT
Created-By: TEST - Apache Maven 3.6.3
Multi-Release: true

With the transformer, the javax reference in Cass-path of Manifest file is not changed, though the javax reference available inside the source class files are changed.

plug-in definition:
<plugin> <groupId>org.eclipse.transformer</groupId> <artifactId>transformer-maven-plugin</artifactId> <version>0.5.0</version> <configuration> <rules> <jakartaDefaults>true</jakartaDefaults> </rules> </configuration> <executions> <execution> <id>transform-and-jar</id> <phase>package</phase> <goals> <!-- <goal>transform</goal> --> <!-- This goal transforms javax to jakarta --> <goal>jar</goal> <!-- This goal creates a JAR file with the transformed classes --> </goals> <configuration> <classifier>ee10</classifier> <!-- Classifier for the new JAR file --> <!-- Add any other configurations needed for the plugin --> <artifact> <groupId>${project.groupId}</groupId> <artifactId>${project.artifactId}</artifactId> <version>${project.version}</version> </artifact> </configuration> </execution> </executions> </plugin>

@bjhargrave
Copy link
Member

Thanks for the explanation. Transformer does not do anything with the Class-Path manifest header since it references things outside of the jar. The ManifestActionImpl only processes select manifest headers for package name changes.

private static final Set<String> SELECT_ATTRIBUTES = Sets.of("DynamicImport-Package", "Import-Package",
"Export-Package", "Subsystem-Content", "IBM-API-Package", "Provide-Capability", "Require-Capability");

So for this case, you will need to modify the Class-Path manifest entry in some other way.

@bjhargrave bjhargrave changed the title Manifest not transformed Manifest Class-Path header not transformed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants