diff options
author | gjoranv <gv@yahooinc.com> | 2023-06-30 21:18:06 +0200 |
---|---|---|
committer | gjoranv <gv@yahooinc.com> | 2023-07-03 22:37:54 +0200 |
commit | d357a5846a24c3a12a07075c0d7a1d5900151b92 (patch) | |
tree | 3e9be237883eed781d7f520688554155b52c6c34 /bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java | |
parent | 127832a12081c56731f5b669c1a2a0b2bd6568e6 (diff) |
Retrive provided artifacts from Class-Path instead of custom header
- Move generic jar file processing to util/JarFiles
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.java | 11 |
1 files changed, 2 insertions, 9 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 a7276a7c7ed..b9025d8fb65 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 @@ -29,13 +29,13 @@ import java.util.stream.Stream; import static com.yahoo.container.plugin.bundle.AnalyzeBundle.exportedPackagesAggregated; import static com.yahoo.container.plugin.bundle.AnalyzeBundle.nonPublicApiPackagesAggregated; -import static com.yahoo.container.plugin.bundle.AnalyzeBundle.providedArtifacts; import static com.yahoo.container.plugin.classanalysis.Packages.disallowedImports; import static com.yahoo.container.plugin.osgi.ExportPackages.exportsByPackageName; import static com.yahoo.container.plugin.osgi.ImportPackages.calculateImports; import static com.yahoo.container.plugin.util.Artifacts.VESPA_GROUP_ID; import static com.yahoo.container.plugin.util.Artifacts.getVespaArtifact; import static com.yahoo.container.plugin.util.Files.allDescendantFiles; +import static com.yahoo.container.plugin.util.JarFiles.providedArtifactsFromClassPath; /** @@ -125,7 +125,7 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo { // Having our wanted artifact as provided guarantees that log output does not contain its exported packages logMissingPackages(exportedPackagesFromProvidedDeps, projectPackages, compileJarsPackages, includedPackages); - logProvidedArtifactsIncluded(artifactsToInclude, providedArtifacts(wantedProvidedArtifact.get().getFile())); + logProvidedArtifactsIncluded(artifactsToInclude, providedArtifactsFromClassPath(wantedProvidedArtifact.get().getFile())); } else if (! suppressWarningMissingImportPackages && jdisc_core.isEmpty()) { // TODO: Remove jdisc_core clause above and instead add suppressWarning to necessary vespa modules. warnOrThrow(("This project does not have '%s' as provided dependency, so the generated 'Import-Package' " + @@ -178,13 +178,6 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo { 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(ProvidedArtifact::new) - .map(ProvidedArtifact::stringValue) - .collect(Collectors.joining(","))); - } } private void addManifestPropertiesForUserBundles(Map<String, String> manifestContent, |