Add a list of classpath dependencies
@param {Array} dependencies list of classpath
@param {String} extension dependencies extension (default: ".js")
429764
function (dependencies, extension) {
            if (dependencies) {
                for (var i = dependencies.length - 1; i >= 0; i--) {
                    this.addDependency(dependencies[i], extension);
                }
            }
        }
1284426
private void renderBundleDependenciesLinks(String requestedPath, BundleRendererContext ctx, Writer out,
			boolean debugOn, List<JoinableResourceBundle> dependencies) throws IOException {

		if (dependencies != null && !dependencies.isEmpty()) {
			for (JoinableResourceBundle dependencyBundle : dependencies) {
				if (debugOn) {
					addComment("Start adding dependency '" + dependencyBundle.getId() + "'", out);
				}
				renderBundleLinks(dependencyBundle, requestedPath, ctx, out, debugOn, false);
				if (debugOn) {
					addComment("Finished adding dependency '" + dependencyBundle.getId() + "'", out);
				}
			}
		}
	}
1202180
private Collection<DependencyInfo> collectPackageJsonDependencies(Collection<BomFile> packageJsons) {
        Collection<DependencyInfo> dependencies = new LinkedList<>();
        ConcurrentHashMap<DependencyInfo, BomFile> dependencyPackageJsonMap = new ConcurrentHashMap<>();
        ExecutorService executorService = Executors.newWorkStealingPool(NUM_THREADS);
        Collection<EnrichDependency> threadsCollection = new LinkedList<>();
        for (BomFile packageJson : packageJsons) {
            if (packageJson != null && packageJson.isValid()) {
                // do not add new dependencies if 'npm ls' already returned all
                DependencyInfo dependency = new DependencyInfo();
                dependencies.add(dependency);
                threadsCollection.add(new EnrichDependency(packageJson, dependency, dependencyPackageJsonMap, npmAccessToken));
                logger.debug("Collect package.json of the dependency in the file: {}", dependency.getFilename());
            }
        }
        runThreadCollection(executorService, threadsCollection);
        logger.debug("set hierarchy of the dependencies");
        // remove duplicates dependencies
        Map<String, DependencyInfo> existDependencies = new HashMap<>();
        Map<DependencyInfo, BomFile> dependencyPackageJsonMapWithoutDuplicates = new HashMap<>();
        for (Map.Entry<DependencyInfo, BomFile> entry : dependencyPackageJsonMap.entrySet()) {
            DependencyInfo keyDep = entry.getKey();
            String key = keyDep.getSha1() + keyDep.getVersion() + keyDep.getArtifactId();
            if (!existDependencies.containsKey(key)) {
                existDependencies.put(key, keyDep);
                dependencyPackageJsonMapWithoutDuplicates.put(keyDep, entry.getValue());
            }
        }
        setHierarchy(dependencyPackageJsonMapWithoutDuplicates, existDependencies);
        return existDependencies.values();
    }
1272618
protected function resolveDependencies( array $dependencies )
	{
		$results = [];

		foreach( $dependencies as $dependency ) {
			// If the class is null, the dependency is a string or some other primitive type
			$results[] = !is_null( $class = $dependency->getClass() )
				? $this->resolveClass( $dependency )
				: null;
		}

		return $results;
	}
342378
function buildDependencyPaths(self, context) {
  var dependencies = {};

  context.__dependencyPaths__.forEach(function (p) {
    var dep = new DependencyFile(p, self.environment.stat(p).mtime,
                                 self.environment.getFileDigest(p));
    dependencies[JSON.stringify(dep)] = dep;
  });

  _.forEach(context.__dependencyAssets__, function (p) {
    var dep, asset;

    if (p === self.pathname) {
      dep = new DependencyFile(p, self.environment.stat(p).mtime,
                               self.environment.getFileDigest(p));
      dependencies[JSON.stringify(dep)] = dep;
      return;
    }

    asset = self.environment.findAsset(p, { bundle: false });

    if (asset) {
      asset.dependencyPaths.forEach(function (dep) {
        dependencies[JSON.stringify(dep)] = dep;
      });
    }
  });

  prop(self, '__dependencyPaths__', _.values(dependencies));
}
15340
function addModulesToPackageJson(externalModules, packageJson, pathToPackageRoot) {
  _.forEach(externalModules, externalModule => {
    const splitModule = _.split(externalModule, '@');
    // If we have a scoped module we have to re-add the @
    if (_.startsWith(externalModule, '@')) {
      splitModule.splice(0, 1);
      splitModule[0] = '@' + splitModule[0];
    }
    let moduleVersion = _.join(_.tail(splitModule), '@');
    // We have to rebase file references to the target package.json
    moduleVersion = rebaseFileReferences(pathToPackageRoot, moduleVersion);
    packageJson.dependencies = packageJson.dependencies || {};
    packageJson.dependencies[_.first(splitModule)] = moduleVersion;
  });
}
244564
function lookForExternalDependenciesRES( _def, resources, depFile ) {
  if ( !_def ) return;
  try {
    const def = convertExternalDependencyDefinition( _def );
    for ( const dep of Object.keys( def ) ) {
      if ( def[ dep ] === "" ) {
        // `res: { "bob/foo.png": "" }` is equivalent to
        // `res: { "bob/foo.png": "bob/foo.png" }`
        def[ dep ] = dep;
      }
      const
      srcDep = Project.srcOrLibPath( `mod/${dep}` ) ||
        Project.srcOrLibPath( dep );
      if ( !srcDep ) {
        Fatal.fire(
          `Unable to find dependency file "${dep}" nor "mod/${dep}"!`,
          depFile.getAbsoluteFilePath()
        );
      }
      resources[ srcDep ] = Project.wwwPath( def[ dep ] );
    }
  } catch ( ex ) {
    Fatal.fire(
      `Unable to parse RES dependencies: ${JSON.stringify(_def)}!\n${ex}`,
      depFile
    );
  }
}
1097283
async function resolveDependencies(rootFolder) {
    const includeFile = path.join(rootFolder, constants.INCLUDE_FILE);
    const includeJson = fs.readJsonSync(includeFile, 'utf8');
    await recDependencies(includeJson.dependencies, true);
    return depencyList;
}
1350863
private void validateExtension(LocalExtension localExtension, boolean dependencies)
    {
        Collection<String> namespaces = DefaultInstalledExtension.getNamespaces(localExtension);

        if (namespaces == null) {
            if (dependencies || !DefaultInstalledExtension.isDependency(localExtension, null)) {
                try {
                    validateExtension(localExtension, null, Collections.emptyMap());
                } catch (InvalidExtensionException e) {
                    if (this.logger.isDebugEnabled()) {
                        this.logger.warn("Invalid extension [{}]", localExtension.getId(), e);
                    } else {
                        this.logger.warn("Invalid extension [{}] ({})", localExtension.getId(),
                            ExceptionUtils.getRootCauseMessage(e));
                    }

                    addInstalledExtension(localExtension, null, false);
                }
            }
        } else {
            for (String namespace : namespaces) {
                if (dependencies || !DefaultInstalledExtension.isDependency(localExtension, namespace)) {
                    try {
                        validateExtension(localExtension, namespace, Collections.emptyMap());
                    } catch (InvalidExtensionException e) {
                        if (this.logger.isDebugEnabled()) {
                            this.logger.warn("Invalid extension [{}] on namespace [{}]", localExtension.getId(),
                                namespace, e);
                        } else {
                            this.logger.warn("Invalid extension [{}] on namespace [{}] ({})", localExtension.getId(),
                                namespace, ExceptionUtils.getRootCauseMessage(e));
                        }

                        addInstalledExtension(localExtension, namespace, false);
                    }
                }
            }
        }
    }
157573
protected void addRelevantPluginDependencies(Set<Artifact> artifacts) throws MojoExecutionException {
        if (pluginDependencies == null) {
            return;
        }

        Iterator<Artifact> iter = this.pluginDependencies.iterator();
        while (iter.hasNext()) {
            Artifact classPathElement = iter.next();
            getLog().debug("Adding plugin dependency artifact: " + classPathElement.getArtifactId() + " to classpath");
            artifacts.add(classPathElement);
        }
    }
1164332
private <T> List<Object> getDependencies(T extension) {
    return new ArrayList<>(evaluateAnnotatedClasses(extension, DependsUpon.class));
  }
574231
protected function resolveDependencies(array $dependencies)
    {
        foreach ($dependencies as $dependency => $type) {
            call_user_func_array([$this, $type], [$dependency]);
        }
    }
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());
    }
  }
473504
private static void addDependency(List<Dependency> dependencies, MavenCoordinates requiredArtifact, Constants.ArtifactType type, String scope) {
		Dependency dependency = new Dependency();
		dependency.setGroupId(requiredArtifact.getGroupId());
		dependency.setArtifactId(requiredArtifact.getArtifactId());
		dependency.setVersion(requiredArtifact.getVersion());

		if(scope!=null){
			dependency.setScope(scope);
		}
		if (type != null) {
			dependency.setType(type.getType());
		}
		dependencies.add(dependency);
	}
222239
function createDependencyLinks (dep, pkg, cb) {
  var depdir = path.join(npm.dir, dep.name, dep.version)
    , depsOn = path.join( depdir
                        , "dependson"
                        , pkg.name+"@"+pkg.version
                        )
    , deps = path.join(depdir, "node_modules", pkg.name)
    , targetRoot = path.join(npm.dir, pkg.name, pkg.version)
    , dependentLink = path.join( npm.dir
                               , pkg.name
                               , pkg.version
                               , "dependents"
                               , dep.name + "@" + dep.version
                               )
  asyncMap
    ( [ [ link, targetRoot, depsOn ]
      , [ link, depdir, dependentLink ]
      , [ linkBins, pkg, path.join(depdir, "dep-bin"), false ]
      , [ linkModules, pkg, deps ]
      ]
    , function (c, cb) {
        c.shift().apply(null, c.concat(cb))
      }
    , cb
    )
}
1002030
function DependenciesNotResolvedError(dependencies){
  superError.call(
    this,
    'DependenciesNotResolvedError',
    util.format('Dependencies cannot be resolved: %s', dependencies.join(','))
  );

  this.dependencies = dependencies;
}
28816
public void setDependencies( Collection<org.sonatype.aether.graph.Dependency> dependencies ) {
        for ( org.sonatype.aether.graph.Dependency dep : dependencies ) {
            addDependency( dep );
        }
    }