JbiResolutionListener listener = resolveProject();   Set sharedLibraries = new HashSet(); Set includes = new HashSet(); for (Iterator iter = project.getArtifacts().iterator(); iter.hasNext();) { Artifact artifact = (Artifact) iter.next(); if (!artifact.isOptional() && filter.include(artifact)) { MavenProject project = null; try { project = projectBuilder.buildFromRepository(artifact, remoteRepos, localRepo); } catch (ProjectBuildingException e) { getLog().warn( "Unable to determine packaging for dependency : " + artifact.getArtifactId() + " assuming jar"); } String type = project != null ? project.getPackaging() : artifact.getType(); if ("jbi-shared-library".equals(type)) { removeBranch(listener, artifact); } else if ("jar".equals(type)) { includes.add(artifact); } } }  includes.retainAll(getArtifacts(listener.getRootNode(), new HashSet()));  for (Iterator iter = includes.iterator(); iter.hasNext();) { Artifact artifact = (Artifact) iter.next(); try { getLog().info("Including: " + artifact); FileUtils.copyFileToDirectory(artifact.getFile(), new File(workDirectory, LIB_DIRECTORY)); } catch (IOException e) { throw new JbiPluginException("Unable to copy file " + artifact.getFile(), e); } } }
JbiResolutionListener listener = resolveProject();   Set sharedLibraries = new HashSet(); Set includes = new HashSet(); for (Iterator iter = project.getArtifacts().iterator(); iter.hasNext();) { Artifact artifact = (Artifact) iter.next(); if (!artifact.isOptional() && filter.include(artifact)) { MavenProject project = null; try { project = projectBuilder.buildFromRepository(artifact, remoteRepos, localRepo); } catch (ProjectBuildingException e) { getLog().warn( "Unable to determine packaging for dependency : " + artifact.getArtifactId() + " assuming jar"); } String type = project != null ? project.getPackaging() : artifact.getType(); if ("jbi-shared-library".equals(type)) { removeBranch(listener, artifact); } else if ("jar".equals(type)) { includes.add(artifact); } } }   for (Iterator iter = retainArtifacts(includes, listener).iterator(); iter .hasNext();) { Artifact artifact = (Artifact) iter.next(); try { getLog().info("Including: " + artifact); FileUtils.copyFileToDirectory(artifact.getFile(), new File( workDirectory, LIB_DIRECTORY)); } catch (IOException e) { throw new JbiPluginException("Unable to copy file " + artifact.getFile(), e); } } }
    private void createUnpackedInstaller() throws JbiPluginException {        if (!workDirectory.isDirectory()) {            if (!workDirectory.mkdirs()) {                throw new JbiPluginException("Unable to create work directory: " + workDirectory);            }        }        File projectArtifact = new File(outputDirectory, project.getArtifactId() + "-" + project.getVersion() + ".jar");        try {            FileUtils.copyFileToDirectory(projectArtifact, new File(workDirectory, LIB_DIRECTORY));        } catch (IOException e) {            throw new JbiPluginException("Unable to copy file " + projectArtifact, e);        }        ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME);        JbiResolutionListener listener = resolveProject();        //print(listener.getRootNode(), "");                Set sharedLibraries = new HashSet();        Set includes = new HashSet();        for (Iterator iter = project.getArtifacts().iterator(); iter.hasNext();) {            Artifact artifact = (Artifact) iter.next();            if (!artifact.isOptional() && filter.include(artifact)) {                MavenProject project = null;                try {                    project = projectBuilder.buildFromRepository(artifact, remoteRepos, localRepo);                } catch (ProjectBuildingException e) {                    getLog().warn(                            "Unable to determine packaging for dependency : "                                    + artifact.getArtifactId()                                    + " assuming jar");                }                String type = project != null ? project.getPackaging() : artifact.getType();                if ("jbi-shared-library".equals(type)) {                    removeBranch(listener, artifact);                } else if ("jar".equals(type)) {                    includes.add(artifact);                }            }        }        //print(listener.getRootNode(), "");        includes.retainAll(getArtifacts(listener.getRootNode(), new HashSet()));                for (Iterator iter = includes.iterator(); iter.hasNext();) {            Artifact artifact = (Artifact) iter.next();            try {                getLog().info("Including: " + artifact);                FileUtils.copyFileToDirectory(artifact.getFile(), new File(workDirectory, LIB_DIRECTORY));            } catch (IOException e) {                throw new JbiPluginException("Unable to copy file " + artifact.getFile(), e);            }        }    }