Can merge artifact with another version
authorMathieu Baudier <mbaudier@argeo.org>
Wed, 9 Mar 2022 14:52:45 +0000 (15:52 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Wed, 9 Mar 2022 14:52:45 +0000 (15:52 +0100)
org.argeo.slc.factory/src/org/argeo/slc/factory/A2Factory.java

index e1310c1c441e6c7a0eca0de2e0309efddf0773c4..ede73f186d5ffd1932058c38b86f916796ad3313 100644 (file)
@@ -263,7 +263,8 @@ public class A2Factory {
                        if ("".equals(m2Coordinates))
                                continue artifacts;
                        DefaultArtifact artifact = new DefaultArtifact(m2Coordinates.trim());
-                       artifact.setVersion(m2Version);
+                       if (artifact.getVersion() == null)
+                               artifact.setVersion(m2Version);
                        URL url = MavenConventionsUtils.mavenRepoUrl(repoStr, artifact);
                        Path downloaded = download(url, originBase, artifact.toM2Coordinates() + ".jar");
                        JarEntry entry;
@@ -273,6 +274,8 @@ public class A2Factory {
                                                continue entries;
                                        if (entry.getName().endsWith(".RSA") || entry.getName().endsWith(".SF"))
                                                continue entries;
+                                       if (entry.getName().startsWith("META-INF/versions/"))
+                                               continue entries;
                                        Path target = targetBundleDir.resolve(entry.getName());
                                        Files.createDirectories(target.getParent());
                                        if (!Files.exists(target)) {