Search in sources :

Example 1 with AnalyzeDepMgt

use of org.apache.maven.plugins.dependency.analyze.AnalyzeDepMgt in project maven-dependency-plugin by apache.

the class TestAnalyzeDepMgt method setUp.

protected void setUp() throws Exception {
    mojo = new AnalyzeDepMgt();
    MavenProject project = new DependencyProjectStub();
    stubFactory = new DependencyArtifactStubFactory(new File(""), false);
    Set<Artifact> allArtifacts = stubFactory.getMixedArtifacts();
    Set<Artifact> directArtifacts = stubFactory.getClassifiedArtifacts();
    exclusionArtifact = stubFactory.getReleaseArtifact();
    directArtifacts.add(exclusionArtifact);
    ex = new Exclusion();
    ex.setArtifactId(exclusionArtifact.getArtifactId());
    ex.setGroupId(exclusionArtifact.getGroupId());
    exclusion = new Dependency();
    exclusion.setArtifactId(exclusionArtifact.getArtifactId());
    exclusion.setGroupId(exclusionArtifact.getGroupId());
    exclusion.setType(exclusionArtifact.getType());
    exclusion.setClassifier("");
    exclusion.setVersion("3.0");
    exclusion.addExclusion(ex);
    List<Dependency> list = new ArrayList<Dependency>();
    list.add(exclusion);
    depMgt = new DependencyManagement();
    depMgt.setDependencies(list);
    project.setArtifacts(allArtifacts);
    project.setDependencyArtifacts(directArtifacts);
    mojo.setProject(project);
}
Also used : AnalyzeDepMgt(org.apache.maven.plugins.dependency.analyze.AnalyzeDepMgt) MavenProject(org.apache.maven.project.MavenProject) Exclusion(org.apache.maven.model.Exclusion) ArrayList(java.util.ArrayList) Dependency(org.apache.maven.model.Dependency) DependencyProjectStub(org.apache.maven.plugins.dependency.testUtils.stubs.DependencyProjectStub) File(java.io.File) Artifact(org.apache.maven.artifact.Artifact) DependencyManagement(org.apache.maven.model.DependencyManagement) DependencyArtifactStubFactory(org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory)

Example 2 with AnalyzeDepMgt

use of org.apache.maven.plugins.dependency.analyze.AnalyzeDepMgt in project maven-plugins by apache.

the class TestAnalyzeDepMgt method setUp.

protected void setUp() throws Exception {
    mojo = new AnalyzeDepMgt();
    MavenProject project = new DependencyProjectStub();
    stubFactory = new DependencyArtifactStubFactory(new File(""), false);
    Set<Artifact> allArtifacts = stubFactory.getMixedArtifacts();
    Set<Artifact> directArtifacts = stubFactory.getClassifiedArtifacts();
    exclusionArtifact = stubFactory.getReleaseArtifact();
    directArtifacts.add(exclusionArtifact);
    ex = new Exclusion();
    ex.setArtifactId(exclusionArtifact.getArtifactId());
    ex.setGroupId(exclusionArtifact.getGroupId());
    exclusion = new Dependency();
    exclusion.setArtifactId(exclusionArtifact.getArtifactId());
    exclusion.setGroupId(exclusionArtifact.getGroupId());
    exclusion.setType(exclusionArtifact.getType());
    exclusion.setClassifier("");
    exclusion.setVersion("3.0");
    exclusion.addExclusion(ex);
    List<Dependency> list = new ArrayList<Dependency>();
    list.add(exclusion);
    depMgt = new DependencyManagement();
    depMgt.setDependencies(list);
    project.setArtifacts(allArtifacts);
    project.setDependencyArtifacts(directArtifacts);
    mojo.setProject(project);
}
Also used : AnalyzeDepMgt(org.apache.maven.plugins.dependency.analyze.AnalyzeDepMgt) MavenProject(org.apache.maven.project.MavenProject) Exclusion(org.apache.maven.model.Exclusion) ArrayList(java.util.ArrayList) Dependency(org.apache.maven.model.Dependency) DependencyProjectStub(org.apache.maven.plugins.dependency.testUtils.stubs.DependencyProjectStub) File(java.io.File) Artifact(org.apache.maven.artifact.Artifact) DependencyManagement(org.apache.maven.model.DependencyManagement) DependencyArtifactStubFactory(org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory)

Aggregations

File (java.io.File)2 ArrayList (java.util.ArrayList)2 Artifact (org.apache.maven.artifact.Artifact)2 Dependency (org.apache.maven.model.Dependency)2 DependencyManagement (org.apache.maven.model.DependencyManagement)2 Exclusion (org.apache.maven.model.Exclusion)2 AnalyzeDepMgt (org.apache.maven.plugins.dependency.analyze.AnalyzeDepMgt)2 DependencyArtifactStubFactory (org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory)2 DependencyProjectStub (org.apache.maven.plugins.dependency.testUtils.stubs.DependencyProjectStub)2 MavenProject (org.apache.maven.project.MavenProject)2