/* (non-Javadoc)
@see com.tobedevoured.naether.api.Naether#addDependencies(com.tobedevoured.naether.maven.Project, java.util.List)
979275
public void addDependencies( Project project, List<String> scopes ) throws ProjectException {
        for ( org.apache.maven.model.Dependency dependency : project.getDependencies(scopes) ) {
            addDependency( dependency );
        }
        
        // Add remote repositories from pom
        for ( Repository repo : project.getMavenModel().getRepositories() ) {
            this.addRemoteRepository( repo.getId(), repo.getLayout(), repo.getUrl() );
        }
    }
291515
public void addRequiredBundles(Set<String> bundles) {
		// TODO manage transitive dependencies
		// don't require self
		Set<String> bundlesToMerge;
		String bundleName = (String) getMainAttributes().get(BUNDLE_SYMBOLIC_NAME);
		if (bundleName != null) {
			int idx = bundleName.indexOf(';');
			if (idx >= 0) {
				bundleName = bundleName.substring(0, idx);
			}
		}
		if (bundleName != null && bundles.contains(bundleName)
				|| projectName != null && bundles.contains(projectName)) {
			bundlesToMerge = new LinkedHashSet<String>(bundles);
			bundlesToMerge.remove(bundleName);
			bundlesToMerge.remove(projectName);
		} else {
			bundlesToMerge = bundles;
		}
		String s = (String) getMainAttributes().get(REQUIRE_BUNDLE);
		Wrapper<Boolean> modified = Wrapper.wrap(this.modified);
		String result = mergeIntoCommaSeparatedList(s, bundlesToMerge, modified, lineDelimiter);
		this.modified = modified.get();
		getMainAttributes().put(REQUIRE_BUNDLE, result);
	}
1183044
@Override
   public void setupComplexAddonProject(Project project, Iterable<AddonId> dependencyAddons)
            throws FileNotFoundException, FacetNotFoundException
   {
      FacetFactory facetFactory = getFacetFactory();
      DependencyInstaller dependencyInstaller = getDependencyInstaller();
      generateReadme(project);
      MetadataFacet metadata = project.getFacet(MetadataFacet.class);
      String projectName = metadata.getProjectName();
      metadata.setProjectName(projectName + "-parent");

      project.getFacet(PackagingFacet.class).setPackagingType("pom");

      facetFactory.install(project, AddonParentFacet.class);
      facetFactory.install(project, ForgeBOMFacet.class);

      Project addonProject = createSubmoduleProject(project, "addon", projectName, AddonAddonFacet.class);
      Project apiProject = createSubmoduleProject(project, "api", projectName + "-api", AddonAPIFacet.class,
               CDIFacet_1_1.class);
      Project implProject = createSubmoduleProject(project, "impl", projectName + "-impl", AddonImplFacet.class,
               CDIFacet_1_1.class);
      Project spiProject = createSubmoduleProject(project, "spi", projectName + "-spi", AddonSPIFacet.class);
      Project testsProject = createSubmoduleProject(project, "tests", projectName + "-tests", AddonTestFacet.class);

      Dependency apiProjectDependency = apiProject.getFacet(MetadataFacet.class).getOutputDependency();
      Dependency implProjectDependency = implProject.getFacet(MetadataFacet.class).getOutputDependency();

      Dependency spiProjectDependency = DependencyBuilder.create(
               spiProject.getFacet(MetadataFacet.class).getOutputDependency())
               .setClassifier(FORGE_ADDON_CLASSIFIER);

      Dependency addonProjectDependency = DependencyBuilder.create(
               addonProject.getFacet(MetadataFacet.class).getOutputDependency())
               .setClassifier(FORGE_ADDON_CLASSIFIER);

      dependencyInstaller.installManaged(project,
               DependencyBuilder.create(addonProjectDependency).setVersion("${project.version}"));
      dependencyInstaller.installManaged(project,
               DependencyBuilder.create(apiProjectDependency).setVersion("${project.version}"));
      dependencyInstaller.installManaged(project,
               DependencyBuilder.create(implProjectDependency).setVersion("${project.version}"));
      dependencyInstaller.installManaged(project,
               DependencyBuilder.create(spiProjectDependency).setVersion("${project.version}"));

      for (Project p : Arrays.asList(addonProject, apiProject, implProject, spiProject))
      {
         JavaSourceFacet javaSource = p.getFacet(JavaSourceFacet.class);
         javaSource.saveJavaSource(Roaster.create(JavaPackageInfoSource.class).setPackage(javaSource.getBasePackage()));
      }

      installSelectedAddons(project, dependencyAddons, true);
      installSelectedAddons(addonProject, dependencyAddons, false);
      installSelectedAddons(apiProject, dependencyAddons, false);
      installSelectedAddons(testsProject, dependencyAddons, false);

      dependencyInstaller.install(addonProject, DependencyBuilder.create(apiProjectDependency));
      dependencyInstaller.install(addonProject, DependencyBuilder.create(implProjectDependency)
               .setOptional(true)
               .setScopeType("runtime"));
      dependencyInstaller.install(addonProject, DependencyBuilder.create(spiProjectDependency));

      dependencyInstaller.install(implProject, DependencyBuilder.create(apiProjectDependency).setScopeType("provided"));
      dependencyInstaller.install(implProject, DependencyBuilder.create(spiProjectDependency).setScopeType("provided"));

      dependencyInstaller.install(apiProject, DependencyBuilder.create(spiProjectDependency).setScopeType("provided"));

      dependencyInstaller.install(testsProject, addonProjectDependency);
   }
1270763
@Override
    public Collection<Dependency> getDependencies() {
        return dependencies == null ? Collections.<Dependency>emptyList() : dependencies;
    }
1184071
private List<Dependency> getProvisionableDependencies()
    {
        List<Dependency> dependencies = new ArrayList<Dependency>();
        getLog().info( "Adding dependencies in scope " + dependencyScope );
        for( Dependency d : getDependencies() )
        {
            if( d.getScope() != null && d.getScope().equalsIgnoreCase( dependencyScope ) )
            {
                dependencies.add( d );
            }
        }

        return dependencies;
    }
550958
@Override
    public final RESOLVESTAGETYPE addDependency(final MavenDependency dependency) throws IllegalArgumentException {
        if (dependency == null) {
            throw new IllegalArgumentException("dependency must be specified");
        }
        final MavenDependency resolved = this.resolveDependency(dependency);
        this.session.getDependenciesForResolution().add(resolved);
        return this.covarientReturn();
    }
109171
public void addDependentResourceReference(ResourceReference<?> resourceReference) {
        if (resourceReferences == null) {
            this.resourceReferences = new ArrayList<ResourceReference<?>>();
        }
        this.resourceReferences.add(resourceReference);
    }
821012
public void setDependencies(Collection<String> dependencies)
    {
        StringBuilder sb = new StringBuilder("");
        for(String dependency : dependencies)
        {
            sb.append(dependency);
            sb.append(File.pathSeparator);
        }

        replace("${classpaths}", sb.toString());
    }
708549
private void addDependency(DynamicProperty dynamic, String placeholder) {
        List<DynamicProperty> l = placeholderToDynamics.get(placeholder);
        if (l == null) {
            l = new ArrayList<DynamicProperty>();
            placeholderToDynamics.put(placeholder, l);
        }
        if (!l.contains(dynamic)) {
            l.add(dynamic);
        }
        dynamic.addPlaceholder(placeholder);
    }
95040
public void addDependency (T dependant, T dependee)
    {
        _orphans.remove(dependant);
        DependencyNode<T> dependantNode = _nodes.get(dependant);
        if (dependantNode == null) {
            throw new IllegalArgumentException("Unknown dependant? " + dependant);
        }
        DependencyNode<T> dependeeNode = _nodes.get(dependee);
        if (dependeeNode == null) {
            throw new IllegalArgumentException("Unknown dependee? " + dependee);
        }
        if (dependee == dependant || dependsOn(dependee, dependant)) {
            throw new IllegalArgumentException("Refusing to create circular dependency.");
        }
        dependantNode.parents.add(dependeeNode);
        dependeeNode.children.add(dependantNode);
    }
169789
public final void addDependentSoftwareSystems() {
        getModel().getSoftwareSystems().stream()
                .filter(softwareSystem -> softwareSystem.hasEfferentRelationshipWith(this.getSoftwareSystem()))
                .forEach(this::add);
    }
797119
public function addClassDependency(string $class, string $package, bool $required = true, bool $devDependency = false)
    {
        if ($devDependency) {
            $this->devDependencies[] = [
                'class' => $class,
                'name' => $package,
                'required' => $required,
            ];
        } else {
            $this->dependencies[] = [
                'class' => $class,
                'name' => $package,
                'required' => $required,
            ];
        }
    }
809913
private void addRelations(List<RelationHolder> rlHolders, Map<String, Object> values)
    {
        if (rlHolders != null)
        {
            for (RelationHolder relation : rlHolders)
            {
                values.put(relation.getRelationName(), relation.getRelationValue());
            }
        }
    }
5919
@SuppressWarnings({"unchecked", "rawtypes"})
    protected void registerDependency(List additionalList, GrailsPlugin plugin) {
        if (!addedNames.contains(plugin.getName())) {
            addedNames.add(plugin.getName());
            additionalList.add(plugin);
            addPluginDependencies(additionalList, plugin);
        }
    }
642364
protected void addDependencies(Archive<?> archive) {
        String version = getConfiguration().getCitrusVersion();
        CitrusArchiveBuilder archiveBuilder;

        if (version != null) {
            archiveBuilder = CitrusArchiveBuilder.version(version);
        } else {
            archiveBuilder = CitrusArchiveBuilder.latestVersion();
        }

        if (archive instanceof EnterpriseArchive) {
            EnterpriseArchive ear = (EnterpriseArchive) archive;
            ear.addAsModules(archiveBuilder.all().build());
        } else if (archive instanceof WebArchive) {
            WebArchive war = (WebArchive) archive;
            war.addAsLibraries(archiveBuilder.all().build());
        }
    }
1005615
public void addDependency(final ProcessorGraphNode node) {
        Assert.isTrue(node != this, "A processor can't depends on himself");

        this.dependencies.add(node);
        node.addRequirement(this);
    }
450942
private void addDependent(String pathName, String relativeTo) {
        if (relativeTo != null) {
            Set<String> dependents = dependenctRelativePaths.get(relativeTo);
            if (dependents == null) {
                dependents = new HashSet<String>();
                dependenctRelativePaths.put(relativeTo, dependents);
            }
            dependents.add(pathName);
        }
    }