From: Mathieu Baudier Date: Wed, 7 Feb 2018 20:56:56 +0000 (+0100) Subject: Skip POM artifacts X-Git-Tag: argeo-commons-2.1.71~4 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=e53fa2642b3490c908b214f0d17a3683d820e403;p=lgpl%2Fargeo-commons.git Skip POM artifacts --- diff --git a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/DistributionBundle.java b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/DistributionBundle.java index 0d0cb9321..85bc6d5a5 100644 --- a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/DistributionBundle.java +++ b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/DistributionBundle.java @@ -187,11 +187,13 @@ public class DistributionBundle { try { reader = new BufferedReader(new InputStreamReader(in)); String line = null; - while ((line = reader.readLine()) != null) { + lines: while ((line = reader.readLine()) != null) { StringTokenizer st = new StringTokenizer(line, separator); String moduleName = st.nextToken(); String moduleVersion = st.nextToken(); String relativeUrl = st.nextToken(); + if (relativeUrl.endsWith(".pom")) + continue lines; osgiArtifacts.add(new OsgiArtifact(moduleName, moduleVersion, relativeUrl)); } } catch (Exception e) { @@ -201,8 +203,8 @@ public class DistributionBundle { } /** Convenience method */ - public static DistributionBundle processUrl(String baseUrl, String realtiveUrl, String localCache) { - DistributionBundle distributionBundle = new DistributionBundle(baseUrl, realtiveUrl, localCache); + public static DistributionBundle processUrl(String baseUrl, String relativeUrl, String localCache) { + DistributionBundle distributionBundle = new DistributionBundle(baseUrl, relativeUrl, localCache); distributionBundle.processUrl(); return distributionBundle; } @@ -230,8 +232,8 @@ public class DistributionBundle { localUri = null; } Version version = new Version(osgiArtifact.getVersion()); - if (localUri != null && Files.exists(Paths.get(localUri)) - && version.getQualifier()!=null && version.getQualifier().startsWith("SNAPSHOT")) { + if (localUri != null && Files.exists(Paths.get(localUri)) && version.getQualifier() != null + && version.getQualifier().startsWith("SNAPSHOT")) { urls.add(localCache + osgiArtifact.getRelativeUrl()); } else { urls.add(baseUrl + osgiArtifact.getRelativeUrl());