Search in sources :

Example 1 with DefaultArtifactHandlerManager

use of org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager in project maven-dependency-plugin 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 DefaultArtifactHandlerManager

use of org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager 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 3 with DefaultArtifactHandlerManager

use of org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager in project maven-dependency-plugin 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)

Example 4 with DefaultArtifactHandlerManager

use of org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager 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)4 DefaultArtifactFactory (org.apache.maven.artifact.factory.DefaultArtifactFactory)4 DefaultArtifactHandlerManager (org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager)4 ArtifactFactory (org.apache.maven.artifact.factory.ArtifactFactory)2 ArtifactHandlerManager (org.apache.maven.artifact.handler.manager.ArtifactHandlerManager)2 MavenSession (org.apache.maven.execution.MavenSession)2 MavenProjectStub (org.apache.maven.plugin.testing.stubs.MavenProjectStub)2 StubArtifactRepository (org.apache.maven.plugin.testing.stubs.StubArtifactRepository)2 DependencyArtifactStubFactory (org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory)2 RepositoryManager (org.apache.maven.shared.repository.RepositoryManager)2 SimpleLocalRepositoryManager (org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager)2 DefaultRepositorySystemSession (org.sonatype.aether.util.DefaultRepositorySystemSession)2