Skip to content

Conversation

@weemve
Copy link

@weemve weemve commented Jan 2, 2026

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:

image

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

  • Simplifies migration of third-party libraries to Maven-based .target definitions.
  • Ensures uniform OSGi metadata across all artifacts.
  • Reduces manual work and risk of errors when modifying manifests.

This Pull Request is related to eclipse-m2e/m2e-core#2115

Copy link
Contributor

@laeubi laeubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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_rewrite option 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.java where you're adding timestamp suffixes to exported filenames (e.g., artifact-20260102143055. jar)

Questions:

  1. Is this the correct/complete PR? The screenshot shows UI changes, but there are no UI-related code changes in this PR.
  2. 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?

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

Successfully merging this pull request may close these issues.

2 participants