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;
}
Aggregations