Fix Maven download
authorMathieu Baudier <mbaudier@argeo.org>
Wed, 22 Mar 2023 12:26:44 +0000 (13:26 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Wed, 22 Mar 2023 12:26:44 +0000 (13:26 +0100)
src/org/argeo/build/Repackage.java

index 607a9ab1c583528ac529c4dfb8a0fe716463f78e..e43376503f15b5927bfe93094825d58f10ad07bc 100644 (file)
@@ -794,10 +794,6 @@ public class Repackage {
        /** Download a Maven artifact. */
        Path downloadMaven(URL url, M2Artifact artifact) throws IOException {
                return download(url, mavenBase, M2ConventionsUtils.artifactPath("", artifact));
-//             return download(url, mavenBase, artifact.getGroupId().replace(".", "/") //
-//                             + '/' + artifact.getArtifactId() + '/' + artifact.getVersion() //
-//                             + '/' + artifact.getArtifactId() + "-" + artifact.getVersion()
-//                             + (artifact.getClassifier() != null ? "-" + artifact.getClassifier() : "") + ".jar");
        }
 
        /*
@@ -1578,7 +1574,8 @@ class M2ConventionsUtils {
 
        /** Absolute path to the directories where the files will be stored */
        static String artifactParentPath(String artifactBasePath, M2Artifact artifact) {
-               return artifactBasePath + (artifactBasePath.endsWith("/") ? "" : "/") + artifactParentPath(artifact);
+               return artifactBasePath + (artifactBasePath.endsWith("/") || artifactBasePath.equals("") ? "" : "/")
+                               + artifactParentPath(artifact);
        }
 
        /** Relative path to the directories where the files will be stored */