Add a Dependency of {@link org.sonatype.aether.graph.Dependency}
@param aetherDep {@link org.sonatype.aether.graph.Dependency}
19434
public void addDependency(org.sonatype.aether.graph.Dependency aetherDep) {
        Artifact artifact = aetherDep.getArtifact();

        Dependency dependency = new Dependency();
        dependency.setGroupId( artifact.getGroupId() );
        dependency.setArtifactId( artifact.getArtifactId() );
        dependency.setType( artifact.getExtension() );
        dependency.setVersion( artifact.getVersion() );
        dependency.setScope( aetherDep.getScope() );
        addDependency( dependency );
    }
297298
protected void addToUpstream(BioPAXElement ele, org.biopax.paxtools.query.model.Graph graph)
	{
		AbstractNode node = (AbstractNode) graph.getGraphObject(ele);
		if (node == null) return;

		Edge edge = new EdgeL3(node, this, graph);

		if (isTranscription())
		{
			if (node instanceof ControlWrapper)
			{
				((ControlWrapper) node).setTranscription(true);
			}
		}

		node.getDownstreamNoInit().add(edge);
		this.getUpstreamNoInit().add(edge);
	}
7420
function buildDependencyGraph(module, dependencies, graph) {
	if (module && !graph[module]) {
		graph[module] = [];
	}

	var dependencyNames = Object.keys(dependencies);
	dependencyNames.forEach(function(dependencyName) {
		var dependency = dependencies[dependencyName];

		if (module && graph[module].indexOf(dependencyName) === -1) {
			graph[module].push(dependencyName);
		}

		// Traverse down to this dependency dependencies:
		// Dependency-ception.
		if (dependency.dependencies) {
			buildDependencyGraph(dependencyName, dependency.dependencies, graph);
		}
	});
}
176969
private List<MavenDependencyDescriptor> addManagedDependencies(MavenDependentDescriptor pomDescriptor, DependencyManagement dependencyManagement,
            ScannerContext scannerContext, Class<? extends AbstractDependencyDescriptor> relationClass) {
        if (dependencyManagement == null) {
            return Collections.emptyList();
        }
        List<Dependency> dependencies = dependencyManagement.getDependencies();
        return getDependencies(pomDescriptor, dependencies, relationClass, scannerContext);
    }
429764
function (dependencies, extension) {
            if (dependencies) {
                for (var i = dependencies.length - 1; i >= 0; i--) {
                    this.addDependency(dependencies[i], extension);
                }
            }
        }
629999
private static void addDependencyFactoryToContainer(Object dependencyFactory) {
        try {
            Class clazz = dependencyFactory.getClass();
            for (Field field : ReflectionHelper.getFields(clazz)) {
                if (field.isAnnotationPresent(Dependency.class)) {
                    qualifiers.clear();
                    for (Annotation annotation : field.getAnnotations()) {
                        if (annotation.annotationType().isAnnotationPresent(Qualifier.class)) {
                            qualifiers.add(annotation.annotationType().getCanonicalName());
                        }
                    }
                    dependencyContainer.add(DependencyIdentifier
                                    .getDependencyIdentifierForClass(field, qualifiers),
                            new DependencySource(DependencySource.DependencySourceType.FIELD,
                                    field,
                                    null,
                                    dependencyFactory,
                                    field.isAnnotationPresent(Singleton.class)));
                }
            }
            for (Method method : clazz.getMethods()) {
                if (method.isAnnotationPresent(Dependency.class)) {
                    qualifiers.clear();
                    for (Annotation annotation : method.getAnnotations()) {
                        if (annotation.annotationType().isAnnotationPresent(Qualifier.class)) {
                            qualifiers.add(annotation.annotationType().getCanonicalName());
                        }
                    }
                    dependencyContainer.add(DependencyIdentifier
                                    .getDependencyIdentifierForClass(method, qualifiers),
                            new DependencySource(DependencySource.DependencySourceType.METHOD,
                                    null,
                                    method,
                                    dependencyFactory,
                                    method.isAnnotationPresent(Singleton.class)));
                }
            }
        } catch (Exception e) {
            throw new AvicennaRuntimeException(e);
        }
    }
654113
public void addDependency(Dependency dependency) {
        Dependency newDep = null;
        String classifier = dependency.getArtifact().getClassifier();
        if ( Const.TEST.equals( classifier ) || Const.TEST_JAR.equals( classifier ) ) {
            ArtifactType artifactType = new DefaultArtifactType( Const.TEST_JAR, Const.JAR, Const.TEST_JAR, null );
            
            Artifact artifact = dependency.getArtifact();
            
            artifact = new DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(),
                    null, Const.JAR, artifact.getBaseVersion(), artifactType );
            newDep =  new Dependency(artifact, dependency.getScope());
        } else {
            newDep = dependency;
        }
        dependencies.add(newDep);
    }
840913
private boolean addDeploymentTypeBasedDependencies(ProjectModel projectModel, Pom modulePom)
    {
        if (projectModel.getProjectType() == null)
            return true;
        switch (projectModel.getProjectType()){
            case "ear":
                break;
            case "war":
                modulePom.getDependencies().add(new SimpleDependency(Dependency.Role.API, ApiDependenciesData.DEP_API_SERVLET_31));
                break;
            case "ejb":
                modulePom.getDependencies().add(new SimpleDependency(Dependency.Role.API, ApiDependenciesData.DEP_API_EJB_32));
                modulePom.getDependencies().add(new SimpleDependency(Dependency.Role.API, ApiDependenciesData.DEP_API_CDI));
                modulePom.getDependencies().add(new SimpleDependency(Dependency.Role.API, ApiDependenciesData.DEP_API_JAVAX_ANN));
                break;
            case "ejb-client":
                modulePom.getDependencies().add(new SimpleDependency(Dependency.Role.API, ApiDependenciesData.DEP_API_EJB_CLIENT));
                break;
        }
        return false;
    }
490658
public static void addDependency(Dependency depend,
                                   ClassLoader loader)
  {
    for (; loader != null; loader = loader.getParent()) {
      if (loader instanceof EnvironmentClassLoader) {
        ((EnvironmentClassLoader) loader).addDependency(depend);
        return;
      }
    }
  }
276048
@Override
    public final RESOLVESTAGETYPE addDependencies(final MavenDependency... dependencies)
        throws IllegalArgumentException {
        if (dependencies == null || dependencies.length == 0) {
            throw new IllegalArgumentException("At least one coordinate must be specified");
        }
        for (final MavenDependency dependency : dependencies) {
            if (dependency == null) {
                throw new IllegalArgumentException("null dependency not permitted");
            }
            final MavenDependency resolved = this.resolveDependency(dependency);
            this.session.getDependenciesForResolution().add(resolved);
        }
        return this.covarientReturn();
    }
180078
private void add(final PathEdge edge) {
        int u = edge.either();
        int v = edge.other(u);
        if (rank[u] < rank[v])
            graph[u].add(edge);
        else
            graph[v].add(edge);
    }
83572
private void addToProvideMap(
      Iterable<DependencyInfo> depInfos,
      Map<String, DependencyInfo> providesMap,
      boolean isFromDepsFile) {
    for (DependencyInfo depInfo : depInfos) {
      List<String> provides = new ArrayList<>(depInfo.getProvides());

      // Add a munged symbol to the provides map so that lookups by path requires work as intended.
      if (isFromDepsFile) {
        // Don't add the dependency file itself but every file it says exists instead.
        provides.add(
            loader
                .resolve(
                    PathUtil.makeAbsolute(depInfo.getPathRelativeToClosureBase(), closurePathAbs))
                .toModuleName());
      } else {
        // ES6 modules already provide these munged symbols.
        if (!"es6".equals(depInfo.getLoadFlags().get("module"))) {
          provides.add(loader.resolve(depInfo.getName()).toModuleName());
        }
      }

      // Also add the relative closure path as a provide. At some point we'll swap out the munged
      // symbols for these relative paths. So looks ups by either need to work.
      provides.add(depInfo.getPathRelativeToClosureBase());

      for (String provide : provides) {
        DependencyInfo prevValue = providesMap.put(provide, depInfo);
        // Check for duplicate provides.
        if (prevValue != null) {
          reportDuplicateProvide(provide, prevValue, depInfo);
        }
      }
    }
  }
122968
private void addScoverageDependenciesToClasspath( Artifact scalaScoveragePluginArtifact )
        throws MojoExecutionException
    {
        @SuppressWarnings( "unchecked" )
        Set<Artifact> set = new LinkedHashSet<Artifact>( project.getDependencyArtifacts() );
        set.add( scalaScoveragePluginArtifact );
        project.setDependencyArtifacts( set );
    }
31218
private void addDependency(String symbol, Set<String> seen, List<String> list)
      throws ServiceException {
    DependencyInfo dependency = getDependencyInfo(symbol);
    if (dependency == null) {
      if (this.strictRequires) {
        throw new ServiceException("Unknown require of " + symbol);
      }
    } else if (!seen.containsAll(dependency.getProvides())) {
      seen.addAll(dependency.getProvides());
      for (String require : dependency.getRequiredSymbols()) {
        addDependency(require, seen, list);
      }
      list.add(dependency.getPathRelativeToClosureBase());
    }
  }
1097637
@SuppressWarnings("ReferenceEquality")
    public synchronized void addRelatedDependency(Dependency dependency) {
        if (this == dependency) {
            LOGGER.warn("Attempted to add a circular reference - please post the log file to issue #172 here "
                    + "https://github.com/jeremylong/DependencyCheck/issues/172");
            LOGGER.debug("this: {}", this);
            LOGGER.debug("dependency: {}", dependency);
        } else if (!relatedDependencies.add(dependency)) {
            LOGGER.debug("Failed to add dependency, likely due to referencing the same file as another dependency in the set.");
            LOGGER.debug("this: {}", this);
            LOGGER.debug("dependency: {}", dependency);
        }
    }
532892
@Override
    protected ResolutionResult resolveDependencies(String projectFolder, String topLevelFolder, Set<String> paketDependenciesFiles) {
        boolean installSuccess = true;
        Collection<DependencyInfo> dependencies = new ArrayList<>();
        List<String> excludes = new LinkedList<>();
        if (paketRunPreStep) {
            File paket = new File(topLevelFolder + Constants.FORWARD_SLASH + PAKET_EXE);
            if (StringUtils.isNotEmpty(this.paketPath)) {
                paket = new File(this.paketPath);
            } else if (!paket.exists()) {
                paket = null;
            }
            installSuccess = !executePreparationStep(topLevelFolder, paket);
        }
        if (installSuccess) {
            String paketLockPath = topLevelFolder + Constants.FORWARD_SLASH + PAKET_LOCK;
            File paketLockFile = new File(paketLockPath);
            if (paketLockFile.exists()) {
                logger.debug("Found paket.lock file: {}", paketLockPath);
                Map<String, List<String>> groupToDirectDependenciesMap = getGroupToDirectDependencies(paketDependenciesFiles.iterator().next());
                if (groupToDirectDependenciesMap != null && !groupToDirectDependenciesMap.keySet().isEmpty()) {
                    Collection<AbstractPaketDependencyCollector> paketDependencyCollectors = new LinkedList<>();
                    for(String groupName : groupToDirectDependenciesMap.keySet()) {
                        if (groupName.equals(MAIN)) {
                            paketDependencyCollectors.add(new MainGroupPaketDependencyCollector(groupToDirectDependenciesMap.get(MAIN), this.paketIgnoredGroups));
                        } else {
                            paketDependencyCollectors.add(new GroupPaketDependencyCollector(groupToDirectDependenciesMap.get(groupName), this.paketIgnoredGroups, groupName));
                        }
                    }
                    logger.info("Start collecting paket dependencies");
                    paketDependencyCollectors.forEach(paketDependencyCollector -> {
                        Collection<AgentProjectInfo> prjectInfo = paketDependencyCollector.collectDependencies(topLevelFolder);
                        dependencies.addAll(prjectInfo.iterator().next().getDependencies());
                    });
                }

                // ignore all the nupkg files in order to not scan them again
                if (!dependencies.isEmpty()) {
                    if (this.ignoreSourceFiles) {
                        excludes.addAll(normalizeLocalPath(projectFolder, topLevelFolder,extensionPattern(PAKET_EXTENSIONS) , null));
                    } else {
                        excludes.addAll(normalizeLocalPath(projectFolder, topLevelFolder, extensionPattern(PAKET_EXTENSIONS), Constants.PACKAGES));
                    }
                }
            } else {
                logger.warn("Could not find paket.lock file in {}. Please execute 'paket install' first.", topLevelFolder);
            }
        } else {
            logger.warn("'paket install' command failed");
        }
        return new ResolutionResult(dependencies, excludes, getDependencyType(), topLevelFolder);
    }
499323
public void setDep(WordForm v) {
    if (Dependency_Type.featOkTst && ((Dependency_Type)jcasType).casFeat_dep == null)
      jcasType.jcas.throwFeatMissing("dep", "com.digitalpebble.rasp.Dependency");
    jcasType.ll_cas.ll_setRefValue(addr, ((Dependency_Type)jcasType).casFeatCode_dep, jcasType.ll_cas.ll_getFSRef(v));}