aboutsummaryrefslogtreecommitdiffstats
path: root/bundle-plugin
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2021-04-02 22:48:04 +0200
committergjoranv <gv@verizonmedia.com>2021-04-12 16:19:42 +0200
commit4e228be54618317680e51a05d04e6161a63e170a (patch)
tree3a5d485e2fbc600b6b40f851d1babe4bb4db6b28 /bundle-plugin
parent1a100a360133a98b232f51d725bd4a05e0dd940a (diff)
Allow container-disc to embed the 'component' artifact
.. to allow deploying it as part of container-disc, instead of a separate bundle.
Diffstat (limited to 'bundle-plugin')
-rw-r--r--bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java9
1 files changed, 7 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 31c8049b0dd..63b3ceb669b 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
@@ -61,12 +61,13 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo {
public void execute() throws MojoExecutionException {
try {
- if (discPreInstallBundle != null && !buildLegacyVespaPlatformBundle)
+ if (discPreInstallBundle != null && ! buildLegacyVespaPlatformBundle)
throw new MojoExecutionException("The 'discPreInstallBundle' parameter can only be used by legacy Vespa platform bundles.");
Artifacts.ArtifactSet artifactSet = Artifacts.getArtifacts(project);
warnOnUnsupportedArtifacts(artifactSet.getNonJarArtifacts());
- warnIfInternalContainerArtifactsAreIncluded(artifactSet.getJarArtifactsToInclude());
+ if (! isContainerDiscArtifact(project.getArtifact()))
+ warnIfInternalContainerArtifactsAreIncluded(artifactSet.getJarArtifactsToInclude());
List<Export> exportedPackagesFromProvidedJars = exportedPackagesAggregated(
artifactSet.getJarArtifactsProvided().stream().map(Artifact::getFile).collect(Collectors.toList()));
@@ -204,6 +205,10 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo {
return a.getArtifactId().equals("component") && a.getGroupId().equals("com.yahoo.vespa");
}
+ private boolean isContainerDiscArtifact(Artifact a) {
+ return a.getArtifactId().equals("container-disc") && a.getGroupId().equals("com.yahoo.vespa");
+ }
+
private PackageTally getProjectClassesTally() {
File outputDirectory = new File(project.getBuild().getOutputDirectory());