Improve import maven dependencies
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 2 Mar 2012 16:40:47 +0000 (16:40 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 2 Mar 2012 16:40:47 +0000 (16:40 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@5138 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/RepoConstants.java
runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/maven/ImportMavenDependencies.java

index e304907e2902ca94334355e2250ed2f778fce50f..d112b64be338b00dc75aa3d74fe12db1858d9b43 100644 (file)
@@ -6,4 +6,6 @@ public interface RepoConstants {
        public final static String REPO_BASEPATH = "/slc:repo";
        public final static String PROXIED_REPOSITORIES = REPO_BASEPATH
                        + "/slc:sources";
+       public final static String DISTRIBUTIONS_BASE_PATH = REPO_BASEPATH
+                       + "/slc:distributions";
 }
index 962e429ea0dafc5d0a382ada39a880d666461810..2ad3e7b5a42fe90e1c4fbaf9d56fe60077b8fa48 100644 (file)
@@ -57,7 +57,7 @@ public class ImportMavenDependencies implements Runnable {
 
        private Session jcrSession;
        private String artifactBasePath = RepoConstants.ARTIFACTS_BASE_PATH;
-       private String distributionsBasePath = "/slc/repo/distributions";
+       private String distributionsBasePath = RepoConstants.DISTRIBUTIONS_BASE_PATH;
        private String distributionName;
 
        private ArtifactIndexer artifactIndexer = new ArtifactIndexer();
@@ -141,7 +141,8 @@ public class ImportMavenDependencies implements Runnable {
                                }
 
                                try {
-                                       String parentPath = artifactBasePath + '/'
+                                       String parentPath = artifactBasePath
+                                                       + (artifactBasePath.endsWith("/") ? "" : "/")
                                                        + artifactParentPath(artifact);
                                        Node parentNode;
                                        if (!jcrSession.itemExists(parentPath)) {