Do not tolerate unresolved URLs 51/84151/6
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 2 Sep 2019 21:40:07 +0000 (23:40 +0200)
committerStephen Kitt <skitt@redhat.com>
Fri, 6 Sep 2019 12:14:04 +0000 (12:14 +0000)
Not resolving repositories results in overrides not being applied
as they should be, leading to half-broken results. Do not tolerate
this happening.

As this causes the build to fail on our failure to expand karaf.etc
property, fix that up as well.

Change-Id: I5f4956215f7f016cdd012945ca0caf3d1ff2882c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
karaf-plugin/src/main/java/org/opendaylight/odlparent/PopulateLocalRepoMojo.java

index eebf3d040d6066bc17f5eb4a14cde56b58933d75..2842338aa724aa04b1ae7c5a3f59ad2bbd284606 100644 (file)
@@ -150,13 +150,15 @@ public class PopulateLocalRepoMojo extends AbstractMojo {
             prop.load(is);
             String featuresRepositories = prop.getProperty("featuresRepositories");
             for (String mvnUrl : featuresRepositories.split(",")) {
-                String fixedUrl = mvnUrl.replace("${karaf.home}", karafHome);
+                String fixedUrl = mvnUrl
+                        .replace("${karaf.home}", karafHome)
+                        .replace("${karaf.etc}", karafHome + "/etc");
                 if (fixedUrl.startsWith("file:")) {
                     try {
                         // Local feature file
                         features.add(featureUtil.readFeature(new File(new URI(fixedUrl))));
                     } catch (URISyntaxException e) {
-                        LOG.info("Could not resolve URI: {}", fixedUrl, e);
+                        throw new IllegalArgumentException("Could not resolve URI: " + fixedUrl, e);
                     }
                 } else {
                     artifacts.add(aetherUtil.resolveArtifact(FeatureUtil.toCoord(new URL(fixedUrl))));