Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes OSGI manifest processing. As it is now, this tool creates invalid manifest headers. My changes fix two problems that I saw while trying to use this:
Export-Package
is not allowed to have a version range.The change by Set jakarta.servlet.* version range to [5.0.0,7.0.0] if specified #42 was too broad and would create things like
which is not valid in OSGI and results in the bundle not being installable. Now, it simply exports the single version:
I was a bit unsure what version to export though so I just went with the lowest.
Import-Package
is unchanged because you are allowed to have a version range there.org.eclipse.osgi
as a dependency to processImport-Package
andExport-Package
. I have seen at least one case that a manifest had something like:The regex pattern would see
javax.servlet
(after being transformed tojakarta.servlet
) and change the version from1.0.0
to[5.0.0,7.0.0)
, even though that version is forsome.package
.This results in issues with other bundles who require
some.package
because they will be importing a version1.0.0
which is no longer being exported.By using
org.eclipse.osgi
we can parse the manifest headers as OSGI would and do it properly. I think it's impossible for a regex to match these perfectly.