summaryrefslogtreecommitdiffstats
path: root/bundle-plugin
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahooinc.com>2023-01-12 17:11:01 +0100
committerBjørn Christian Seime <bjorncs@yahooinc.com>2023-01-20 14:46:37 +0100
commitec5c06887cdfe5c31ae561a0e671fb943b324d04 (patch)
treecae6ff947a669f846914c0db83d6748a597b2024 /bundle-plugin
parentb7e28f7960ba06d10b4bb8b10681acbf34230b32 (diff)
Inline apache http client artifacts in container-apache-http-client-bundle
Allows container-apache-http-client-bundle to be used on classpath for classic fatjars. Since the bundle is now built with Felix's bundle plugin, there is no need to depend on jdisc_core or manually export through `@PublicApi` annotations.
Diffstat (limited to 'bundle-plugin')
-rw-r--r--bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AssembleFatJarMojo.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AssembleFatJarMojo.java b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AssembleFatJarMojo.java
index e9a7d93f8f6..d40ff320cfd 100644
--- a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AssembleFatJarMojo.java
+++ b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AssembleFatJarMojo.java
@@ -123,10 +123,14 @@ public class AssembleFatJarMojo extends AbstractMojo {
private String generateClasspath(Set<Artifact> installedDependencies, SortedSet<Artifact> projectDependencies) {
return projectDependencies.stream()
.filter(installedDependencies::contains)
- .map(d -> d.getFile().getName())
+ .map(AssembleFatJarMojo::filename)
.collect(Collectors.joining(" "));
}
+ private static String filename(Artifact a) {
+ return a.getGroupId().equals("com.yahoo.vespa") ? "%s-jar-with-dependencies.jar".formatted(a.getArtifactId()) : a.getFile().getName();
+ }
+
private File outputFile() {
var a = project.getArtifact();
var name = project.getArtifactId() + "-" + a.getVersion() + "-shaded." + a.getArtifactHandler().getExtension();
@@ -143,7 +147,8 @@ public class AssembleFatJarMojo extends AbstractMojo {
var installedDepsProject = projectDefiningInstalledDependencies.split(":");
var project = session.getAllProjects().stream()
.filter(p -> p.getGroupId().equals(installedDepsProject[0]) && p.getArtifactId().equals(installedDepsProject[1]))
- .findAny().orElseThrow(() -> new IllegalStateException("Cannot find " + projectDefiningInstalledDependencies));
+ .findAny().orElseThrow(() -> new IllegalStateException(
+ "Cannot find %s. Build from project root with 'mvn install -pl :%s'".formatted(projectDefiningInstalledDependencies, this.project.getArtifactId())));
var req = new DefaultProjectBuildingRequest(session.getProjectBuildingRequest());
req.setProject(project);
var root = dependencyGraphBuilder.buildDependencyGraph(req, null);