use of org.apache.maven.model.RepositoryBase in project ignite by apache.
the class MavenUtils method mavenProjectRepositories.
/**
* @return Collection of configured repositories for the Maven project.
*/
private static Collection<String> mavenProjectRepositories() throws Exception {
String workDir = System.getProperty("user.dir");
File prjPomFile = new File(workDir, "pom.xml");
if (!prjPomFile.exists())
return Collections.emptyList();
Path outPath = Files.createTempFile("effective-pom", "");
try {
exec(buildMvnCommand() + " -f " + workDir + " help:effective-pom -Doutput=" + outPath.toAbsolutePath());
Model model = new MavenXpp3Reader().read(new FileInputStream(outPath.toFile()));
return F.transform(model.getRepositories(), RepositoryBase::getUrl);
} finally {
Files.deleteIfExists(outPath);
}
}
Aggregations