Search in sources :

Example 1 with DefaultArtifactRepositoryFactory

use of org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory in project project-build-plugin by axonivy.

the class CompileMojoRule method provideLocalRepository.

/**
 * maven-plugin-testing-harness can not inject local repositories (though the real runtime supports it).
 * and the default stubs have no sufficient implementation of getPath():
 * @see "http://maven.apache.org/plugin-testing/maven-plugin-testing-harness/examples/repositories.html"
 */
private ArtifactRepository provideLocalRepository() throws IllegalAccessException {
    DefaultArtifactRepositoryFactory factory = new DefaultArtifactRepositoryFactory();
    setVariableValueToObject(factory, "factory", new org.apache.maven.repository.legacy.repository.DefaultArtifactRepositoryFactory());
    LegacySupport legacySupport = new DefaultLegacySupport();
    setVariableValueToObject(factory, "legacySupport", legacySupport);
    ArtifactRepository localRepository = factory.createArtifactRepository("local", "http://localhost", new DefaultRepositoryLayout(), new ArtifactRepositoryPolicy(), new ArtifactRepositoryPolicy());
    setVariableValueToObject(localRepository, "basedir", BaseEngineProjectMojoTest.LOCAL_REPOSITORY);
    return localRepository;
}
Also used : LegacySupport(org.apache.maven.plugin.LegacySupport) DefaultLegacySupport(org.apache.maven.plugin.internal.DefaultLegacySupport) DefaultLegacySupport(org.apache.maven.plugin.internal.DefaultLegacySupport) ArtifactRepositoryPolicy(org.apache.maven.artifact.repository.ArtifactRepositoryPolicy) DefaultArtifactRepositoryFactory(org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory) DefaultRepositoryLayout(org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout) ArtifactRepository(org.apache.maven.artifact.repository.ArtifactRepository)

Aggregations

ArtifactRepository (org.apache.maven.artifact.repository.ArtifactRepository)1 ArtifactRepositoryPolicy (org.apache.maven.artifact.repository.ArtifactRepositoryPolicy)1 DefaultArtifactRepositoryFactory (org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory)1 DefaultRepositoryLayout (org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout)1 LegacySupport (org.apache.maven.plugin.LegacySupport)1 DefaultLegacySupport (org.apache.maven.plugin.internal.DefaultLegacySupport)1