@Override
    public void execute() throws MojoExecutionException {
        Map<Dependencies, String> jarSuffixes = new EnumMap<Dependencies, String>(Dependencies.class);

        if (useCommonAssemblyIds) {
            jarSuffixes.put(Dependencies.WITHOUT, ".jar");
            jarSuffixes.put(Dependencies.WITH, "-jar-with-dependencies.jar");
        } else {
            jarSuffixes.put(Dependencies.WITHOUT, "-without-dependencies.jar");
            jarSuffixes.put(Dependencies.WITH, "-deploy.jar");
        }

        Map<Dependencies, File> jarFiles = new EnumMap<Dependencies, File>(Dependencies.class);
        jarSuffixes.forEach((dep, suffix) -> {
            jarFiles.put(dep, jarFileInBuildDirectory(build().getFinalName(), suffix));
        });

        Path manifestFile = Paths.get(build().getOutputDirectory(), JarFile.MANIFEST_NAME);

        JarArchiver jarWithoutDependencies = new JarArchiver();
        addDirectory(jarWithoutDependencies, Paths.get(build().getOutputDirectory()));
        createArchive(jarWithoutDependencies, jarFiles.get(Dependencies.WITHOUT).toPath(), manifestFile);
        project.getArtifact().setFile(jarFiles.get(Dependencies.WITHOUT));

        JarArchiver jarWithDependencies = new JarArchiver();
        addDirectory(jarWithDependencies, Paths.get(build().getOutputDirectory()));
        addArtifacts(jarWithDependencies, Artifacts.getArtifactsToInclude(project));
        createArchive(jarWithDependencies, jarFiles.get(Dependencies.WITH).toPath(), manifestFile);

        if (attachBundleArtifact) {
            projectHelper.attachArtifact(project,
                                         project.getArtifact().getType(),
                                         bundleClassifierName,
                                         jarFiles.get(Dependencies.WITH));
        }
    }
@author Tony Vaagenes
@author Olli Virtanen
@author bjorncs
bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AssembleContainerPluginMojo.java