use of org.apache.maven.plugin.testing.stubs.StubArtifactRepository in project maven-plugins by apache.
the class TestClassifierTypeTranslator method setUp.
protected void setUp() throws Exception {
super.setUp("classifiertype-translator", false);
artifactHandlerManager = new DefaultArtifactHandlerManager();
this.setVariableValueToObject(artifactHandlerManager, "artifactHandlers", new HashMap());
artifactFactory = new DefaultArtifactFactory();
this.setVariableValueToObject(artifactFactory, "artifactHandlerManager", artifactHandlerManager);
artifactRepository = new StubArtifactRepository(null);
DependencyArtifactStubFactory factory = new DependencyArtifactStubFactory(null, false);
artifacts = factory.getMixedArtifacts();
repoManager = lookup(RepositoryManager.class);
MavenSession session = newMavenSession(new MavenProjectStub());
buildingRequest = session.getProjectBuildingRequest();
DefaultRepositorySystemSession repoSession = (DefaultRepositorySystemSession) session.getRepositorySession();
repoSession.setLocalRepositoryManager(new SimpleLocalRepositoryManager(stubFactory.getWorkingDir()));
}
use of org.apache.maven.plugin.testing.stubs.StubArtifactRepository in project maven-plugins by apache.
the class DefaultDependencyResolverTest method newMavenSession.
protected MavenSession newMavenSession(MavenProject project) {
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
MavenExecutionResult result = new DefaultMavenExecutionResult();
MavenRepositorySystemSession repoSession = new MavenRepositorySystemSession();
repoSession.setLocalRepositoryManager(LegacyLocalRepositoryManager.wrap(new StubArtifactRepository("target/local-repo"), null));
MavenSession session = new MavenSession(getContainer(), repoSession, request, result);
session.setCurrentProject(project);
session.setProjects(Arrays.asList(project));
return session;
}
Aggregations