Add Option to Rewrite Existing Manifest for Maven Artifacts#2164
Add Option to Rewrite Existing Manifest for Maven Artifacts#2164weemve wants to merge 2 commits intoeclipse-pde:masterfrom
Conversation
laeubi
left a comment
There was a problem hiding this comment.
@weemve Thank you for the contribution, but I'm unclear about what this PR is actually trying to achieve. There's a significant disconnect between the description and the code changes:
What the PR description says:
- Adding a new
generate_rewriteoption to the Maven Artifact Target Entry Dialog - Allowing manifest regeneration for Maven artifacts that already have manifests
- Related to manifest handling for OSGi metadata
What the code actually changes:
- ~90% of the changes are purely javadoc reformatting (TargetBundle.java, ManifestUtils.java) with no functional impact
- The only functional change is in
ExportTargetJob.javawhere you're adding timestamp suffixes to exported filenames (e.g.,artifact-20260102143055. jar)
Questions:
- Is this the correct/complete PR? The screenshot shows UI changes, but there are no UI-related code changes in this PR.
- What is the relationship between timestamping exported files and rewriting manifests?
Regarding the underlying feature:
Per my comment on the related m2e PR (eclipse-m2e/m2e-core#2115 (review)), I have concerns about the overall approach to manifest rewriting. Please address those architectural questions first before proceeding with the PDE changes.
Could you clarify what changes are actually needed in PDE for this feature?
|
As the discussion at m2e seem to indicate this change is not needed I'll close it for now. If later we need any changes they should be submitted as a new PR focused on PDE with a clear description what it changes in the light of generic PDE target support. |
Problem
Currently, the .target platform supports generating an OSGi manifest when a Maven artifact is missing one, using the option generate. However, there is no way to modify or regenerate an existing manifest for Maven-based libraries.
When migrating third-party libraries to Maven locations in .target files, many artifacts already include a manifest that does not meet our requirements (e.g., incomplete OSGi metadata). We need a mechanism to rewrite these manifests without manually editing the JARs.
Proposed Solution
Introduce a new option to rewrite a manifest file in the Maven Artifact Target Entry Dialog:
The new option generate_rewrite behaves like the current generate mode for missing manifests, but applies even when a manifest already exists. So, if generate_rewrite is enabled, the manifest will be regenerated based on the same logic used for missing manifests. This allows consistent handling of Maven artifacts during migration without manual intervention.
Benefits
This Pull Request is related to eclipse-m2e/m2e-core#2115