@Override
        public void modifyOutputStream(JarOutputStream os) throws IOException {
            var manifest = new Manifest();
            var attributes = manifest.getMainAttributes();
            attributes.put(Attributes.Name.MANIFEST_VERSION, "1.0");
            attributes.putValue("Class-Path", classpath);
            attributes.putValue("Created-By", "vespa container maven plugin");
            if (mainclass != null) attributes.putValue("Main-Class", mainclass);
            var entry = new JarEntry(JarFile.MANIFEST_NAME);
            entry.setTime(System.currentTimeMillis());
            os.putNextEntry(entry);
            var baos = new ByteArrayOutputStream();
            manifest.write(baos);
            os.write(baos.toByteArray());
            os.flush();
        }
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