aboutsummaryrefslogtreecommitdiffstats
path: root/bundle-plugin
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2020-07-03 01:03:36 +0200
committergjoranv <gv@verizonmedia.com>2020-07-03 01:03:36 +0200
commitba052272db890fc38c23bbf68d45265cf24ab4b1 (patch)
tree1f02a7bc489d74664c334c03d60d83a5157031a2 /bundle-plugin
parentcf70945884366172dbfec057f29361c6826455b0 (diff)
Fail the build if the 'component' artifact is embedded.
+ Improve the error message.
Diffstat (limited to 'bundle-plugin')
-rw-r--r--bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java11
1 files changed, 5 insertions, 6 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 864c8d6fe9c..d5aaa5888b2 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
@@ -181,16 +181,15 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo {
artifact.getId(), artifact.getType())));
}
- // TODO: fail the build by throwing a MojoExecutionException
private void warnIfInternalContainerArtifactsAreIncluded(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).
- */
+ * not be equal to those seen by the framework (e.g. AbstractComponent). */
if (includedArtifacts.stream().anyMatch(this::isJdiscComponentArtifact)) {
- getLog().warn("This project includes the 'com.yahoo.vespa:component' artifact in compile scope." +
- " It must be set to scope 'provided' to avoid resource leaks in your application at runtime." +
- " The build will fail on a future Vespa version unless this is fixed.");
+ throw new MojoExecutionException(
+ "This project includes the 'com.yahoo.vespa:component' artifact in compile scope." +
+ " It must have scope 'provided' to avoid resource leaks in your application at runtime." +
+ " Please use 'mvn dependency:tree' to find the root cause.");
}
}