Gets the list of artifact to consider during the analysis.

@param mojo       the mojo
@param graph      the dependency graph builder
@param transitive do we have to include transitive dependencies
@return the set of artifacts
178251
public static Set<Artifact> getArtifactsToConsider(AbstractWisdomMojo mojo, DependencyGraphBuilder graph,
                                                       boolean transitive, ArtifactFilter filter) {
        // No transitive.
        Set<Artifact> artifacts;
        if (!transitive) {
            // Direct dependencies that the current project has (no transitives)
            artifacts = mojo.project.getDependencyArtifacts();
        } else {
            // All dependencies that the current project has, including transitive ones. Contents are lazily
            // populated, so depending on what phases have run dependencies in some scopes won't be
            // included.
            artifacts = getTransitiveDependencies(mojo, graph, filter);
        }
        return artifacts;
    }
646076
public Set<Deque<Archive>> inverseDependences() throws IOException {
        // create a new dependency finder to do the analysis
        DependencyFinder dependencyFinder = new DependencyFinder(configuration, DEFAULT_FILTER);
        try {
            // parse all archives in unnamed module to get compile-time dependences
            Stream<Archive> archives =
                Stream.concat(configuration.initialArchives().stream(),
                              configuration.classPathArchives().stream());
            if (apiOnly) {
                dependencyFinder.parseExportedAPIs(archives);
            } else {
                dependencyFinder.parse(archives);
            }

            Graph.Builder<Archive> builder = new Graph.Builder<>();
            // include all target nodes
            targets().forEach(builder::addNode);

            // transpose the module graph
            configuration.getModules().values().stream()
                .forEach(m -> {
                    builder.addNode(m);
                    m.descriptor().requires().stream()
                        .map(Requires::name)
                        .map(configuration::findModule)  // must be present
                        .forEach(v -> builder.addEdge(v.get(), m));
                });

            // add the dependences from the analysis
            Map<Archive, Set<Archive>> dependences = dependencyFinder.dependences();
            dependences.entrySet().stream()
                .forEach(e -> {
                    Archive u = e.getKey();
                    builder.addNode(u);
                    e.getValue().forEach(v -> builder.addEdge(v, u));
                });

            // transposed dependence graph.
            Graph<Archive> graph = builder.build();
            trace("targets: %s%n", targets());

            // Traverse from the targets and find all paths
            // rebuild a graph with all nodes that depends on targets
            // targets directly and indirectly
            return targets().stream()
                .map(t -> findPaths(graph, t))
                .flatMap(Set::stream)
                .collect(Collectors.toSet());
        } finally {
            dependencyFinder.shutdown();
        }
    }
320977
def _InitializeGraph(self, os_name, artifact_list):
    
    dependencies = artifact_registry.REGISTRY.SearchDependencies(
        os_name, artifact_list)
    artifact_names, attribute_names = dependencies

    self._AddAttributeNodes(attribute_names)
    self._AddArtifactNodesAndEdges(artifact_names)
501536
public static List<ProducerDecoratorBean> getDecoratedProducers(HttpServletRequest req, List<ProducerAO> producers, Map<String, GraphDataBean> graphData){

        Map<IDecorator, List<ProducerAO>> decoratorMap = new HashMap<>(producers.size());
        for (ProducerAO producer : producers){
            try{
                IDecorator decorator = findOrCreateDecorator(producer);
                List<ProducerAO> decoratedProducers = decoratorMap.get(decorator);
                if (decoratedProducers == null){
                    decoratedProducers = new ArrayList<>();
                    decoratorMap.put(decorator, decoratedProducers);

                    for(StatValueAO statBean : producer.getFirstStatsValues()){
                        String graphKey = decorator.getName()+ '_' +statBean.getName();
                        GraphDataBean graphDataBean = new GraphDataBean(decorator.getName()+ '_' +statBean.getJsVariableName(), statBean.getName());
                        graphData.put(graphKey, graphDataBean);
                    }
                }
                decoratedProducers.add(producer);
            }catch(IndexOutOfBoundsException e){
                //producer has no stats at all, ignoring
            }
        }

        Set<Map.Entry<IDecorator, List<ProducerAO>>> entries = decoratorMap.entrySet();
        List<ProducerDecoratorBean> beans = new ArrayList<>(entries.size());
        for (Map.Entry<IDecorator, List<ProducerAO>> entry : entries){
            IDecorator decorator = entry.getKey();
            ProducerDecoratorBean b = new ProducerDecoratorBean();
            b.setName(decorator.getName());
            b.setCaptions(decorator.getCaptions());

            for (ProducerAO p : entry.getValue()) {
                try {
                    List<StatValueAO> values = p.getFirstStatsValues();
                    for (StatValueAO valueBean : values){
                        String graphKey = decorator.getName()+ '_' +valueBean.getName();
                        GraphDataBean bean = graphData.get(graphKey);
                        if (bean==null) {
                            // FIXME!
                            log.warn("unable to find bean for key: " + graphKey);
                        } else {
                            bean.addValue(new GraphDataValueBean(p.getProducerId(), valueBean.getRawValue()));
                        }
                    }
                }catch(UnknownIntervalException e){
                    //do nothing, apparently we have a decorator which has no interval support for THIS interval.
                }
            }
            b.setProducerBeans(StaticQuickSorter.sort(decoratorMap.get(decorator), getProducerBeanSortType(b, req)));
            beans.add(b);
        }

        return beans;
    }
1298775
private List copyDependencies( File javaDirectory )
        throws MojoExecutionException
    {

        ArtifactRepositoryLayout layout = new DefaultRepositoryLayout();

        List list = new ArrayList();

        File repoDirectory = new File(javaDirectory, "repo");
        repoDirectory.mkdirs();

        // First, copy the project's own artifact
        File artifactFile = project.getArtifact().getFile();
        list.add( repoDirectory.getName() +"/" +layout.pathOf(project.getArtifact()));

        try
        {
            FileUtils.copyFile( artifactFile, new File(repoDirectory, layout.pathOf(project.getArtifact())) );
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException( "Could not copy artifact file " + artifactFile + " to " + javaDirectory );
        }

        Set artifacts = project.getArtifacts();

        Iterator i = artifacts.iterator();

        while ( i.hasNext() )
        {
            Artifact artifact = (Artifact) i.next();

            File file = artifact.getFile();
            File dest = new File(repoDirectory, layout.pathOf(artifact));

            getLog().debug( "Adding " + file );

            try
            {
                FileUtils.copyFile( file, dest);
            }
            catch ( IOException e )
            {
                throw new MojoExecutionException( "Error copying file " + file + " into " + javaDirectory, e );
            }

            list.add( repoDirectory.getName() +"/" + layout.pathOf(artifact) );
        }

        return list;

    }
239094
public List<Artifact> getArtifacts(final Boolean hasLicense) throws GrapesCommunicationException {
        final Client client = getClient();
        final WebResource resource = client.resource(serverURL).path(RequestUtils.getArtifactsPath());
        final ClientResponse response = resource.queryParam(ServerAPI.HAS_LICENSE_PARAM, hasLicense.toString())
                .accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);

        client.destroy();
        if(ClientResponse.Status.OK.getStatusCode() != response.getStatus()){
            final String message = "Failed to get artifacts";
            if(LOG.isErrorEnabled()) {
                LOG.error(String.format(HTTP_STATUS_TEMPLATE_MSG, message, response.getStatus()));
            }
            throw new GrapesCommunicationException(message, response.getStatus());
        }

        return response.getEntity(ArtifactList.class);
    }
1161004
private Map<String, Map<String, Set<String>>> getDependencies(Context context,
                                                                  Collection<JavaFileObject> explicitJFOs,
                                                                  boolean cp) {
        Map<String, Map<String, Set<String>>> result = new HashMap<>();

        for (CompletionNode cnode : getDependencyNodes(context, explicitJFOs, true)) {

            String fqDep = cnode.getClassSymbol().outermostClass().flatname.toString();
            String depPkg = Util.pkgNameOfClassName(fqDep);

            Map<String, Set<String>> depsForThisClass = result.get(depPkg);
            if (depsForThisClass == null) {
                result.put(depPkg, depsForThisClass = new HashMap<>());
            }

            Set<String> fqDeps = depsForThisClass.get(fqDep);
            if (fqDeps == null) {
                depsForThisClass.put(fqDep, fqDeps = new HashSet<>());
            }

            for (Node<?,?> depNode : getAllDependencies(cnode)) {
                CompletionNode cDepNode = (CompletionNode) depNode;
                // Symbol is not regarded to depend on itself.
                if (cDepNode == cnode) {
                    continue;
                }
                // Skip anonymous classes
                if (cDepNode.getClassSymbol().fullname == null) {
                    continue;
                }
                if (isSymbolRelevant(cp, cDepNode.getClassSymbol())) {
                    fqDeps.add(cDepNode.getClassSymbol().outermostClass().flatname.toString());
                }
            }

            // The completion dependency graph is not transitively closed for inheritance relations.
            // For sjavac's purposes however, a class depends on it's super super type, so below we
            // make sure that we include super types.
            for (ClassSymbol cs : allSupertypes(cnode.getClassSymbol())) {
                if (isSymbolRelevant(cp, cs)) {
                    fqDeps.add(cs.outermostClass().flatname.toString());
                }
            }

        }
        return result;
    }
688895
@Override
    @GraphTransaction
    public List<String> getTraitNames(String guid) throws AtlasException {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Retrieving trait names for entity={}", guid);
        }

        AtlasVertex instanceVertex = graphHelper.getVertexForGUID(guid);
        return GraphHelper.getTraitNames(instanceVertex);
    }
706072
def GetArtifactsDependenciesClosure(name_list, os_name=None):
  """"""

  artifacts = set(REGISTRY.GetArtifacts(os_name=os_name, name_list=name_list))

  dependencies = set()
  for art in artifacts:
    dependencies.update(GetArtifactDependencies(art, recursive=True))
  if dependencies:
    artifacts.update(
        set(
            REGISTRY.GetArtifacts(
                os_name=os_name, name_list=list(dependencies))))

  return artifacts
1237548
protected List<File> getClassPath() throws MojoExecutionException {
		if (this.bufferedClasspath == null) {
			final Set<String> classPath = new LinkedHashSet<>();
			final MavenProject project = getProject();
			classPath.add(project.getBuild().getSourceDirectory());
			try {
				classPath.addAll(project.getCompileClasspathElements());
			} catch (DependencyResolutionRequiredException e) {
				throw new MojoExecutionException(e.getLocalizedMessage(), e);
			}
			for (final Artifact dep : project.getArtifacts()) {
				classPath.add(dep.getFile().getAbsolutePath());
			}
			classPath.remove(project.getBuild().getOutputDirectory());
			final List<File> files = new ArrayList<>();
			for (final String filename : classPath) {
				final File file = new File(filename);
				if (file.exists()) {
					files.add(file);
				} else {
					getLog().warn(MessageFormat.format(Messages.AbstractSarlBatchCompilerMojo_10, filename));
				}
			}
			this.bufferedClasspath = files;
		}
		return this.bufferedClasspath;
	}
148866
protected Collection<Artifact> getAllDependencies() throws Exception {
        List<Artifact> artifacts = new ArrayList<Artifact>();

        for (Iterator<?> dependencies = project.getDependencies().iterator(); dependencies.hasNext();) {
            Dependency dependency = (Dependency)dependencies.next();

            String groupId = dependency.getGroupId();
            String artifactId = dependency.getArtifactId();

            VersionRange versionRange;
            try {
                versionRange = VersionRange.createFromVersionSpec(dependency.getVersion());
            } catch (InvalidVersionSpecificationException e) {
                throw new MojoExecutionException("unable to parse version", e);
            }

            String type = dependency.getType();
            if (type == null) {
                type = "jar";
            }
            String classifier = dependency.getClassifier();
            boolean optional = dependency.isOptional();
            String scope = dependency.getScope();
            if (scope == null) {
                scope = Artifact.SCOPE_COMPILE;
            }

            Artifact art = this.artifactFactory.createDependencyArtifact(groupId, artifactId, versionRange,
                    type, classifier, scope, null, optional);

            if (scope.equalsIgnoreCase(Artifact.SCOPE_SYSTEM)) {
                art.setFile(new File(dependency.getSystemPath()));
            }

            List<String> exclusions = new ArrayList<String>();
            for (Iterator<?> j = dependency.getExclusions().iterator(); j.hasNext();) {
                Exclusion e = (Exclusion)j.next();
                exclusions.add(e.getGroupId() + ":" + e.getArtifactId());
            }

            ArtifactFilter newFilter = new ExcludesArtifactFilter(exclusions);

            art.setDependencyFilter(newFilter);

            artifacts.add(art);
        }

        return artifacts;
    }
147048
private void processDependencies()
            throws MojoExecutionException
    {

        processDependency( getProject().getArtifact() );

        AndArtifactFilter filter = new AndArtifactFilter();
        // filter.add( new ScopeArtifactFilter( dependencySet.getScope() ) );

        if ( dependencies != null && dependencies.getIncludes() != null && !dependencies.getIncludes().isEmpty() )
        {
            filter.add( new IncludesArtifactFilter( dependencies.getIncludes() ) );
        }
        if ( dependencies != null && dependencies.getExcludes() != null && !dependencies.getExcludes().isEmpty() )
        {
            filter.add( new ExcludesArtifactFilter( dependencies.getExcludes() ) );
        }

        Collection<Artifact> artifacts =
                isExcludeTransitive() ? getProject().getDependencyArtifacts() : getProject().getArtifacts();

        for ( Artifact artifact : artifacts )
        {
            if ( filter.include( artifact ) )
            {
                processDependency( artifact );
            }
        }
    }
242011
private Artifact getArtifactFromMavenCoordinates(final String artifact) throws MojoFailureException {

    String[] parts = StringUtils.split(artifact, ":");

    String version;
    String packaging = null;
    String classifier = null;

    switch (parts.length) {
      case 3:
        // groupId:artifactId:version
        version = parts[2];
        break;

      case 4:
        // groupId:artifactId:packaging:version
        packaging = parts[2];
        version = parts[3];
        break;

      case 5:
        // groupId:artifactId:packaging:classifier:version
        packaging = parts[2];
        classifier = parts[3];
        version = parts[4];
        break;

      default:
        throw new MojoFailureException("Invalid artifact: " + artifact);
    }

    String groupId = parts[0];
    String artifactId = parts[1];

    return createArtifact(artifactId, groupId, version, packaging, classifier);
  }
89252
@Override
    public List<String> findVersions(final Artifact artifact) {
        return Arrays.asList(new String[]{artifact.getVersion()});
    }
1349319
public Graph<Node> dependenceGraph() {
        Graph.Builder<Node> builder = new Graph.Builder<>();

        archives().stream()
            .map(analyzer.results::get)
            .filter(deps -> !deps.dependencies().isEmpty())
            .flatMap(deps -> deps.dependencies().stream())
            .forEach(d -> addEdge(builder, d));
        return builder.build();
    }
509817
protected DependencyNode getRootNodeDependecyTree() throws MojoExecutionException{
    try {
      ArtifactFilter artifactFilter = null;

      // works for only maven 3. Use of dependency graph component not handled for maven 2
      // as current version of NAR already requires Maven 3.x
      rootNode = dependencyGraphBuilder.buildDependencyGraph(getMavenProject(), artifactFilter);

    } catch (DependencyGraphBuilderException exception) {
      throw new MojoExecutionException("Cannot build project dependency graph", exception);
    }

    return rootNode;
  }
672417
@Override
    public List<String> getDependencies() {
        List<String> dependencies = new ArrayList<String>();
        if (container.getSingle("dependencies") != null) {
            for (Node dep : container.getSingle("dependencies").get("dependency")) {
                dependencies.add(dep.getText());
            }
        }
        return dependencies;
    }