+ public Node getMaven(Session distSession, String coords)
+ throws RepositoryException {
+ Artifact artifact = new DefaultArtifact(coords);
+ String path = MavenConventionsUtils.artifactPath(mavenProxyBase,
+ artifact);
+
+ // exists
+ if (distSession.itemExists(path))
+ return distSession.getNode(path);
+
+ for (String mavenRepo : mavenRepositories) {
+ String url = mavenRepo
+ + MavenConventionsUtils.artifactPath("/", artifact);
+ try {
+ Node node = loadUrlToPath(url, distSession, path);
+ if (node != null) {
+ // checksums
+ try {
+ loadUrlToPath(url + ".md5", distSession, path + ".md5");
+ } catch (FileNotFoundException e) {
+ // silent
+ }
+ try {
+ loadUrlToPath(url + ".sha1", distSession, path
+ + ".sha1");
+ } catch (FileNotFoundException e) {
+ // silent
+ }
+ return node;
+ }
+ } catch (FileNotFoundException e) {
+ if (log.isDebugEnabled())
+ log.debug("Maven " + coords
+ + " could not be downloaded from " + url);
+ }
+ }
+ throw new SlcException("Could not download Maven " + coords);
+ }
+