@Override
    public void execute() throws MojoExecutionException {
        var installedDependencies = resolveThirdPartyArtifactsInstalledInVespaHomeLibJars();
        var projectDependencies = new TreeSet<>(project.getArtifacts());
        File outputFile = outputFile();
        var archiveFilter = new ArchiveFilter() {
            @Override public String getArtifact() { return null; }
            @Override public Set<String> getIncludes() { return Set.of(); }
            @Override public Set<String> getExcludes() {
                var values = new TreeSet<>(defaultExcludes);
                values.addAll(List.of(excludes));
                return values;
            }
            @Override public boolean getExcludeDefaults() { return true; }
        };
        var jarsToShade = projectDependencies.stream()
                .filter(d -> !installedDependencies.contains(d) && !d.getType().equals("pom") && d.getScope().equals("compile"))
                .map(Artifact::getFile)
                .collect(Collectors.toCollection(LinkedHashSet::new));
        jarsToShade.add(project.getArtifact().getFile());
        try {
            var classpath = generateClasspath(installedDependencies, projectDependencies);
            var req = new ShadeRequest();
            req.setJars(jarsToShade);
            req.setUberJar(outputFile);
            req.setFilters(List.of(new SimpleFilter(jarsToShade, archiveFilter)));
            req.setRelocators(List.of());
            req.setResourceTransformers(List.of(new ManifestWriter(classpath, mainClass)));
            req.setShadeSourcesContent(false);
            new DefaultShader().shade(req);
            Files.copy(outputFile.toPath(), finalFile().toPath(), StandardCopyOption.REPLACE_EXISTING);
        } catch (IOException e) {
            throw new MojoExecutionException(e);
        }
    }
Wrapper around maven-shade-plugin's {@link DefaultShader} for packaging Vespa fat jars for `$VESPA_HOME/lib/jars`.
The produced fat jar will add dependencies which are already installed in lib/jars to manifest's "Class-Path" instead of embedding.

@author bjorncs
bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AssembleFatJarMojo.java