Skip to content

Commit 9f1b14c

Browse files
committed
Fix OSGi imports from JDK
Signed-off-by: jansupol <[email protected]>
1 parent 82f9318 commit 9f1b14c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@
695695
<instructions>
696696
<_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
697697
<_nodefaultversion>false</_nodefaultversion>
698+
<_noimportjava>true</_noimportjava>
698699
<Include-Resource>{maven-resources},${project.build.directory}/legal</Include-Resource>
699700
</instructions>
700701
</configuration>

tests/release-test/src/test/java/org/glassfish/jersey/test/artifacts/ManifestTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2024 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2025 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -81,6 +81,12 @@ public void testHasOsgiManifest() throws IOException, XmlPullParserException {
8181
}
8282
}
8383

84+
String importPackage = jarFile.getManifest().getMainAttributes().getValue("Import-Package");
85+
if (importPackage == null) {
86+
testResult.exception().append("No Import-Package in module ").println(jar.getName());
87+
} else if (importPackage.contains("java.lang") || importPackage.contains("java.io")) {
88+
testResult.exception().append("Import-Package contains java.* packages in ").println(jar.getName());
89+
}
8490
}
8591

8692
//Assertions.assertTrue(testResult.result(), "Some error occurred, see previous messages");

0 commit comments

Comments
 (0)