summaryrefslogtreecommitdiffstats
path: root/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java
diff options
context:
space:
mode:
Diffstat (limited to 'bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java')
-rw-r--r--bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java
index 814a9667e8a..e20b42da4e6 100644
--- a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java
+++ b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java
@@ -134,7 +134,7 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo {
Map<String, String> manifestContent = generateManifestContent(artifactSet.getJarArtifactsToInclude(), calculatedImports, includedPackages);
addAdditionalManifestProperties(manifestContent);
- addManifestPropertiesForInternalBundles(manifestContent, includedPackages);
+ addManifestPropertiesForInternalAndCoreBundles(manifestContent, includedPackages, providedJarArtifacts);
addManifestPropertiesForUserBundles(manifestContent, jdiscCore, nonPublicApiUsed);
createManifestFile(Paths.get(project.getBuild().getOutputDirectory()), manifestContent);
@@ -160,13 +160,21 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo {
addIfNotEmpty(manifestContent, "WebInfUrl", webInfUrl);
}
- private void addManifestPropertiesForInternalBundles(Map<String, String> manifestContent, PackageTally includedPackages) {
+ private void addManifestPropertiesForInternalAndCoreBundles(Map<String, String> manifestContent,
+ PackageTally includedPackages,
+ List<Artifact> providedJarArtifacts) {
if (effectiveBundleType() == BundleType.USER) return;
// TODO: this attribute is not necessary, remove?
addIfNotEmpty(manifestContent, "X-JDisc-PublicApi-Package", publicApi(includedPackages));
addIfNotEmpty(manifestContent, "X-JDisc-Non-PublicApi-Export-Package", nonPublicApi(includedPackages));
+
+ if (effectiveBundleType() == BundleType.CORE) {
+ addIfNotEmpty(manifestContent, "X-JDisc-Provided-Artifact", providedJarArtifacts.stream()
+ .map(Artifacts::idAndVersion)
+ .collect(Collectors.joining(",")));
+ }
}
private void addManifestPropertiesForUserBundles(Map<String, String> manifestContent,