diff options
author | gjoranv <gv@verizonmedia.com> | 2021-04-13 12:28:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-13 12:28:42 +0200 |
commit | c752d3e4bcc1946358ccdee716f4141bf87748df (patch) | |
tree | bf3ee4c16006437ac79b893cc09e1e05c8714339 /bundle-plugin | |
parent | 86097c6b1e4a59cef5b9dfcdec021213520b51ac (diff) | |
parent | bbff5a9bb8854d7100b4981af9aa226d74ae0227 (diff) |
Merge pull request #17380 from vespa-engine/gjoranv/merge-di-into-core_2
Gjoranv/merge di into core 2 [run-systemtest]
Diffstat (limited to 'bundle-plugin')
-rw-r--r-- | bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java | 11 |
1 files changed, 8 insertions, 3 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..e1d199c4c9b 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())) + throwIfInternalContainerArtifactsAreIncluded(artifactSet.getJarArtifactsToInclude()); List<Export> exportedPackagesFromProvidedJars = exportedPackagesAggregated( artifactSet.getJarArtifactsProvided().stream().map(Artifact::getFile).collect(Collectors.toList())); @@ -188,7 +189,7 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo { artifact.getId(), artifact.getType()))); } - private void warnIfInternalContainerArtifactsAreIncluded(Collection<Artifact> includedArtifacts) throws MojoExecutionException { + private void throwIfInternalContainerArtifactsAreIncluded(Collection<Artifact> includedArtifacts) throws MojoExecutionException { /* In most cases it's sufficient to test for 'component', as it's the lowest level container artifact, * Embedding container artifacts will cause class loading issues at runtime, because the classes will * not be equal to those seen by the framework (e.g. AbstractComponent). */ @@ -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()); |