use of io.fabric8.maven.util.MavenRepositoryURL in project fabric8 by jboss-fuse.
the class DeploymentUpdater method parseMavenRepositoryURLs.
protected List<MavenRepositoryURL> parseMavenRepositoryURLs() throws MalformedURLException {
List<MavenRepositoryURL> repositories = new ArrayList<MavenRepositoryURL>();
String text = getRepositories();
if (Strings.isNotBlank(text)) {
StringTokenizer iter = new StringTokenizer(text);
while (iter.hasMoreTokens()) {
String url = iter.nextToken();
if (url.endsWith(",")) {
url = url.substring(0, url.length() - 1);
}
MavenRepositoryURL mavenUrl = new MavenRepositoryURL(url);
repositories.add(mavenUrl);
}
}
return repositories;
}
use of io.fabric8.maven.util.MavenRepositoryURL in project fabric8 by jboss-fuse.
the class OpenShiftPomDeployer method updateRepositories.
/**
* Ensure that the given maven repositories are added to the pom.xml
*/
protected void updateRepositories(Element repositories, List<MavenRepositoryURL> repos) throws XPathExpressionException {
for (MavenRepositoryURL repo : repos) {
String url = repo.getURL().toString();
String id = repo.getId();
if (Strings.isNotBlank(url)) {
Element repository = recreateChild(repositories, "repository[url='" + url + "']", "repository", 2);
if (Strings.isNotBlank(id)) {
createAndAppendChild(repository, "id", 3, id);
}
createAndAppendChild(repository, "url", 3, url);
addRepositoryFlag(repository, "releases", repo.isReleasesEnabled());
addRepositoryFlag(repository, "snapshots", repo.isSnapshotsEnabled());
}
}
}
Aggregations