Skip to content

Conversation

@nburnwal09
Copy link

@nburnwal09 nburnwal09 commented Sep 9, 2025

This is to provide a quick fix for adding the available matching version for Imported packages in MANIFEST.MF warning.
Similar to the fix: #1623 and as suggested in here

Attaching screenshot for the quick fix:

image

After applying:

image

@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Test Results

   771 files  ±0     771 suites  ±0   55m 4s ⏱️ - 1m 14s
 3 648 tests ±0   3 594 ✅ +1   54 💤 ±0  0 ❌  - 1 
10 878 runs  ±0  10 715 ✅ +1  163 💤 ±0  0 ❌  - 1 

Results for commit cc2fb8c. ± Comparison against base commit 524971f.

♻️ This comment has been updated with latest results.

@nburnwal09
Copy link
Author

nburnwal09 commented Sep 15, 2025

@HannesWell
Can you please review this PR?

Corrected:
Also, as you suggested here to provide the version range
I have added a method VersionUtil.computeInitialRequirementVersionRange() and providing version range with minor and major versions as quick fix - for both Required packages and Imported packages

exportedPackage.getVersion().toString(), NameVersionDescriptor.TYPE_PACKAGE);
exportedPackage.getExporter().getBundle();

if (("java".equals(name) || name.startsWith("java."))) { //$NON-NLS-1$ //$NON-NLS-2$
Copy link
Contributor

Choose a reason for hiding this comment

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

can this check be moved to the beginning of the loop, as soon as name is available?

Copy link
Author

Choose a reason for hiding this comment

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

done

@nburnwal09 nburnwal09 force-pushed the quickFix_verMatch_import_package branch from adb0579 to 7089fa0 Compare November 24, 2025 05:17
@nburnwal09 nburnwal09 force-pushed the quickFix_verMatch_import_package branch from 7089fa0 to 7687e6f Compare December 1, 2025 12:04
@eclipse-pde-bot
Copy link
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

ui/org.eclipse.pde.core/META-INF/MANIFEST.MF
ui/org.eclipse.pde.ui/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From f296c0b4a4fa6eb57edbc26e6983e65f297b7435 Mon Sep 17 00:00:00 2001
From: Eclipse PDE Bot <[email protected]>
Date: Mon, 1 Dec 2025 12:10:15 +0000
Subject: [PATCH] Version bump(s) for 4.39 stream


diff --git a/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF b/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF
index a83a7c3f04..d1d5acc8e3 100644
--- a/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF
+++ b/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %name
 Bundle-SymbolicName: org.eclipse.pde.core; singleton:=true
-Bundle-Version: 3.21.100.qualifier
+Bundle-Version: 3.21.200.qualifier
 Bundle-Activator: org.eclipse.pde.internal.core.PDECore
 Bundle-Vendor: %provider-name
 Bundle-Localization: plugin
diff --git a/ui/org.eclipse.pde.ui/META-INF/MANIFEST.MF b/ui/org.eclipse.pde.ui/META-INF/MANIFEST.MF
index f8db32e0c6..87bb6898ee 100644
--- a/ui/org.eclipse.pde.ui/META-INF/MANIFEST.MF
+++ b/ui/org.eclipse.pde.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %name
 Bundle-SymbolicName: org.eclipse.pde.ui; singleton:=true
-Bundle-Version: 3.16.300.qualifier
+Bundle-Version: 3.16.400.qualifier
 Bundle-Activator: org.eclipse.pde.internal.ui.PDEPlugin
 Bundle-Vendor: %provider-name
 Bundle-Localization: plugin
-- 
2.51.2

Further information are available in Common Build Issues - Missing version increments.

Copy link
Member

@HannesWell HannesWell left a comment

Choose a reason for hiding this comment

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

Just one point from me at the moment, I'll try to do a full review this evening.

Comment on lines 123 to 131
public static String computeInitialRequirementVersionRange(String version) {
if (version != null && VersionUtil.validateVersion(version).isOK()) {
Version pvi = Version.parseVersion(version);
return new VersionRange(
"[" + pvi.getMajor() + "." + pvi.getMinor() + "," + (pvi.getMajor() + 1) + ")") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
.toString();
}
return ""; //$NON-NLS-1$
}
Copy link
Member

Choose a reason for hiding this comment

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

Recently I added a method that does this to ManifestUtils:

public static Optional<VersionRange> createConsumerRequirementRange(Version version) {
if (version != null && !Version.emptyVersion.equals(version)) {
return Optional.ofNullable(new VersionRange(VersionRange.LEFT_CLOSED, //
new Version(version.getMajor(), version.getMinor(), 0), //
new Version(version.getMajor() + 1, 0, 0), //
VersionRange.RIGHT_OPEN));
}
return Optional.empty();
}

Admittedly this method would probably better be moved to this class and probably be used instead of the existing method. That would hopefully add proper version ranges in more places.
I can try to have a look at unifying these as soon as possible. Or if you want to have a look at it, it would be more than welcome.

Copy link
Author

Choose a reason for hiding this comment

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

@HannesWell
I have moved your method createConsumerRequirementRange to VersionUtil class and updated the corresponding callers(found 2 classes - JavaResolutionFactory and ImportPackageObject).
Kindly check the changes.

@nburnwal09 nburnwal09 force-pushed the quickFix_verMatch_import_package branch from 35827e3 to cc2fb8c Compare December 13, 2025 13:10
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.

Create a quickfix to add missing version information

4 participants