Fluent-api builders for maven settings.
Settings settings = newSettings()
.withActiveProfile(newProfile()
.withId("profile")
.withRepository(newRepository()
.withUrl("http://repo1.maven.org/maven2"))).build();
Fluent-api for Eclipse Aether. Easy to resolve/collect/install/deploy artifacts.
//resolve with transitives
List<ArtifactResult> results = aether(localRepositoryFile, settings)
.resolve("ru.yandex.qatools.allure:allure-model:jar:1.3.9").get();
}
//resolve without transitives
List<ArtifactResult> results = aether(localRepositoryFile, settings)
.resolve("ru.yandex.qatools.allure:allure-model:jar:1.3.9", false);
//resolve all given artifacts
List<ArtifactResult> results = aether(localRepo, MAVEN_SETTINGS)
.resolveAll("ru.yandex.qatools.allure:allure-model:jar:1.3.9",
"ru.yandex.qatools.allure:allure-java-annotations:jar:1.3.9").get();
//collect
List<Artifact> artifacts = aether(localRepositoryFile, settings)
.collect("ru.yandex.qatools.allure:allure-model:jar:1.3.9");
//install
aether(localRepositoryFile, settings)
.install(archiveToDeploy, "testGroupId", "testArtifactId", "testVersion");
//deploy
aether(localRepositoryFile, settings)
.deploy(distributionManagement, archiveToDeploy, "testGroupId", "testArtifactId", "testVersion");
Also you have few ways to get resolve results:
//as list of artifact results:
List<ArtifactResult> results = aether(localRepositoryFile, settings)
.resolve("ru.yandex.qatools.allure:allure-model:jar:1.3.9").get();
//as array of urls:
URL[] urls = aether(localRepositoryFile, settings)
.resolve("ru.yandex.qatools.allure:allure-model:jar:1.3.9").getAsUrls();
//as class path:
String[] cp = aether(localRepositoryFile, settings)
.resolve("ru.yandex.qatools.allure:allure-model:jar:1.3.9").getAsClassPath();
//as ClassLoader:
ClassLoader cl = aether(localRepositoryFile, settings)
.resolve("ru.yandex.qatools.allure:allure-model:jar:1.3.9").getAsClassLoader();
Some useful tools, such as ArchiveUtil (configurable unpack jar's), DateUtil and MapUtil.