use of org.apache.maven.model.Dependency in project maven-plugins by apache.
the class TestCopyMojo method getDependencyList.
public List<Dependency> getDependencyList(ArtifactItem item) {
Dependency dep = new Dependency();
dep.setArtifactId(item.getArtifactId());
dep.setClassifier(item.getClassifier());
dep.setGroupId(item.getGroupId());
dep.setType(item.getType());
dep.setVersion("2.0-SNAPSHOT");
Dependency dep2 = new Dependency();
dep2.setArtifactId(item.getArtifactId());
dep2.setClassifier("classifier");
dep2.setGroupId(item.getGroupId());
dep2.setType(item.getType());
dep2.setVersion("2.1");
List<Dependency> list = new ArrayList<Dependency>(2);
list.add(dep2);
list.add(dep);
return list;
}
use of org.apache.maven.model.Dependency in project maven-plugins by apache.
the class TestUnpackMojo method getDependencyList.
public List<Dependency> getDependencyList(ArtifactItem item) {
Dependency dep = new Dependency();
dep.setArtifactId(item.getArtifactId());
dep.setClassifier(item.getClassifier());
dep.setGroupId(item.getGroupId());
dep.setType(item.getType());
dep.setVersion("2.0-SNAPSHOT");
Dependency dep2 = new Dependency();
dep2.setArtifactId(item.getArtifactId());
dep2.setClassifier("classifier");
dep2.setGroupId(item.getGroupId());
dep2.setType(item.getType());
dep2.setVersion("2.1");
List<Dependency> list = new ArrayList<Dependency>(2);
list.add(dep2);
list.add(dep);
return list;
}
use of org.apache.maven.model.Dependency in project maven-plugins by apache.
the class TestUnpackMojo method createArtifacts.
// respects the createUnpackableFile flag of the ArtifactStubFactory
private List<Dependency> createArtifacts(List<Dependency> items) throws IOException {
for (Dependency item : items) {
String classifier = "".equals(item.getClassifier()) ? null : item.getClassifier();
stubFactory.createArtifact(item.getGroupId(), item.getArtifactId(), VersionRange.createFromVersion(item.getVersion()), null, item.getType(), classifier, item.isOptional());
}
return items;
}
use of org.apache.maven.model.Dependency in project maven-plugins by apache.
the class DependencyConvergenceReport method generateConvergence.
/**
* Generate the convergence table for all dependencies
*
* @param locale
* @param sink
* @param conflictingDependencyMap
*/
private void generateConvergence(Locale locale, Sink sink, DependencyAnalyzeResult result) {
sink.section2();
sink.sectionTitle2();
if (isReactorBuild()) {
sink.text(getI18nString(locale, "convergence.caption"));
} else {
sink.text(getI18nString(locale, "convergence.single.caption"));
}
sink.sectionTitle2_();
// print conflicting dependencies
for (Map.Entry<String, List<ReverseDependencyLink>> entry : result.getConflicting().entrySet()) {
String key = entry.getKey();
List<ReverseDependencyLink> depList = entry.getValue();
sink.section3();
sink.sectionTitle3();
sink.text(key);
sink.sectionTitle3_();
generateDependencyDetails(locale, sink, depList);
sink.section3_();
}
// print out snapshots jars
for (ReverseDependencyLink dependencyLink : result.getSnapshots()) {
sink.section3();
sink.sectionTitle3();
Dependency dep = dependencyLink.getDependency();
sink.text(dep.getGroupId() + ":" + dep.getArtifactId());
sink.sectionTitle3_();
List<ReverseDependencyLink> depList = new ArrayList<ReverseDependencyLink>();
depList.add(dependencyLink);
generateDependencyDetails(locale, sink, depList);
sink.section3_();
}
sink.section2_();
}
use of org.apache.maven.model.Dependency in project maven-plugins by apache.
the class ManagementDependencies method getManagementDependenciesByScope.
/**
* @return the managementDependencies by scope
* @see Artifact#SCOPE_COMPILE
* @see Artifact#SCOPE_PROVIDED
* @see Artifact#SCOPE_RUNTIME
* @see Artifact#SCOPE_SYSTEM
* @see Artifact#SCOPE_TEST
*/
public Map<String, List<Dependency>> getManagementDependenciesByScope() {
Map<String, List<Dependency>> dependenciesByScope = new HashMap<String, List<Dependency>>();
for (Dependency dependency : managementDependencies) {
String scope = dependency.getScope() != null ? dependency.getScope() : Artifact.SCOPE_COMPILE;
List<Dependency> multiValue = dependenciesByScope.get(scope);
if (multiValue == null) {
multiValue = new ArrayList<Dependency>();
}
multiValue.add(dependency);
dependenciesByScope.put(scope, multiValue);
}
return dependenciesByScope;
}
Aggregations