use of org.apache.maven.plugins.dependency.resolvers.ResolveDependenciesMojo in project maven-plugins by apache.
the class TestResolveMojo method testresolveTestEnvironment.
/**
* tests the proper discovery and configuration of the mojo
*
* @throws Exception
*/
public void testresolveTestEnvironment() throws Exception {
File testPom = new File(getBasedir(), "target/test-classes/unit/resolve-test/plugin-config.xml");
ResolveDependenciesMojo mojo = (ResolveDependenciesMojo) lookupMojo("resolve", testPom);
assertNotNull(mojo);
assertNotNull(mojo.getProject());
MavenProject project = mojo.getProject();
mojo.setSilent(true);
Set<Artifact> artifacts = this.stubFactory.getScopedArtifacts();
Set<Artifact> directArtifacts = this.stubFactory.getReleaseAndSnapshotArtifacts();
artifacts.addAll(directArtifacts);
project.setArtifacts(artifacts);
project.setDependencyArtifacts(directArtifacts);
mojo.execute();
DependencyStatusSets results = mojo.getResults();
assertNotNull(results);
assertEquals(artifacts.size(), results.getResolvedDependencies().size());
setVariableValueToObject(mojo, "excludeTransitive", Boolean.TRUE);
mojo.execute();
results = mojo.getResults();
assertNotNull(results);
assertEquals(directArtifacts.size(), results.getResolvedDependencies().size());
}
use of org.apache.maven.plugins.dependency.resolvers.ResolveDependenciesMojo in project maven-plugins by apache.
the class TestResolveMojo method testSilent.
public void testSilent() throws Exception {
File testPom = new File(getBasedir(), "target/test-classes/unit/resolve-test/plugin-config.xml");
ResolveDependenciesMojo mojo = (ResolveDependenciesMojo) lookupMojo("resolve", testPom);
mojo.setSilent(false);
assertFalse(mojo.getLog() instanceof SilentLog);
}
Aggregations