summaryrefslogtreecommitdiffstats
path: root/vespa-maven-plugin
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2023-06-28 22:38:24 +0200
committerjonmv <venstad@gmail.com>2023-06-28 22:38:24 +0200
commit87e717e046e51be12eebe66f3da8b0201c3174d0 (patch)
tree6788d491926fda360b55d72517fcfa7e21c97bb5 /vespa-maven-plugin
parent684882aefca3060117a022b897ccd295d9172cc2 (diff)
Handle null tags (the default) in effective-services-mojo
Diffstat (limited to 'vespa-maven-plugin')
-rw-r--r--vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/EffectiveServicesMojo.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/EffectiveServicesMojo.java b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/EffectiveServicesMojo.java
index 7eae86057d4..8104b3c0330 100644
--- a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/EffectiveServicesMojo.java
+++ b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/EffectiveServicesMojo.java
@@ -45,11 +45,12 @@ public class EffectiveServicesMojo extends AbstractVespaDeploymentMojo {
ZoneId zone = zoneOf(environment, region);
Path output = Paths.get(outputDirectory).resolve("services-" + zone.environment().value() + "-" + zone.region().value() + ".xml");
- Files.write(output, effectiveServices(services, zone, InstanceName.from(instance), Tags.fromString(tags)).getBytes(StandardCharsets.UTF_8));
+ Tags tagz = Tags.fromString(tags);
+ Files.write(output, effectiveServices(services, zone, InstanceName.from(instance), tagz).getBytes(StandardCharsets.UTF_8));
getLog().info("Effective services for " + zone +
", instance " + instance +
- ( tags.isEmpty() ? "" : ", tags " + tags ) +
- " written to " + output);
+ ( tags == null ? "" : ", tags '" + tagz) +
+ "' written to " + output);
}
static String effectiveServices(File servicesFile, ZoneId zone, InstanceName instance, Tags tags) throws Exception {