Search in sources :

Example 1 with DefaultArtifactFactory

use of org.apache.maven.artifact.factory.DefaultArtifactFactory 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()));
}
Also used : MavenSession(org.apache.maven.execution.MavenSession) SimpleLocalRepositoryManager(org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager) DefaultArtifactFactory(org.apache.maven.artifact.factory.DefaultArtifactFactory) MavenProjectStub(org.apache.maven.plugin.testing.stubs.MavenProjectStub) DefaultRepositorySystemSession(org.sonatype.aether.util.DefaultRepositorySystemSession) HashMap(java.util.HashMap) StubArtifactRepository(org.apache.maven.plugin.testing.stubs.StubArtifactRepository) RepositoryManager(org.apache.maven.shared.repository.RepositoryManager) SimpleLocalRepositoryManager(org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager) DefaultArtifactHandlerManager(org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager) DependencyArtifactStubFactory(org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory)

Example 2 with DefaultArtifactFactory

use of org.apache.maven.artifact.factory.DefaultArtifactFactory in project maven-plugins by apache.

the class DependencyTestUtils method getArtifactFactory.

public static ArtifactFactory getArtifactFactory() throws IllegalAccessException {
    ArtifactFactory artifactFactory;
    ArtifactHandlerManager manager = new DefaultArtifactHandlerManager();
    setVariableValueToObject(manager, "artifactHandlers", new HashMap());
    artifactFactory = new DefaultArtifactFactory();
    setVariableValueToObject(artifactFactory, "artifactHandlerManager", manager);
    return artifactFactory;
}
Also used : ArtifactFactory(org.apache.maven.artifact.factory.ArtifactFactory) DefaultArtifactFactory(org.apache.maven.artifact.factory.DefaultArtifactFactory) DefaultArtifactFactory(org.apache.maven.artifact.factory.DefaultArtifactFactory) HashMap(java.util.HashMap) ArtifactHandlerManager(org.apache.maven.artifact.handler.manager.ArtifactHandlerManager) DefaultArtifactHandlerManager(org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager) DefaultArtifactHandlerManager(org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager)

Aggregations

HashMap (java.util.HashMap)2 DefaultArtifactFactory (org.apache.maven.artifact.factory.DefaultArtifactFactory)2 DefaultArtifactHandlerManager (org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager)2 ArtifactFactory (org.apache.maven.artifact.factory.ArtifactFactory)1 ArtifactHandlerManager (org.apache.maven.artifact.handler.manager.ArtifactHandlerManager)1 MavenSession (org.apache.maven.execution.MavenSession)1 MavenProjectStub (org.apache.maven.plugin.testing.stubs.MavenProjectStub)1 StubArtifactRepository (org.apache.maven.plugin.testing.stubs.StubArtifactRepository)1 DependencyArtifactStubFactory (org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory)1 RepositoryManager (org.apache.maven.shared.repository.RepositoryManager)1 SimpleLocalRepositoryManager (org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager)1 DefaultRepositorySystemSession (org.sonatype.aether.util.DefaultRepositorySystemSession)1