Pass parent version, rather than just whether there was a vespa parent
@@ -68,19 +68,18 @@ public class ApplicationMojo extends AbstractMojo {
while (current.getParent() != null && current.getParent().getParentArtifact() != null)
current = current.getParent();
- boolean hasVespaParent = false;
+ Version parentVersion = null;
Artifact parentArtifact = current.getParentArtifact();
if (parentArtifact != null && (parentArtifact.getGroupId().startsWith("com.yahoo.vespa.") || parentArtifact.getGroupId().startsWith("ai.vespa."))) {
- hasVespaParent = true;
- Version parentVersion = Version.from(parentArtifact.getVersion());
+ parentVersion = Version.from(parentArtifact.getVersion());
if (parentVersion.compareTo(compileVersion) < 0)
throw new IllegalArgumentException("compile version (" + compileVersion + ") cannot be higher than parent version (" + parentVersion + ")");
}
- String metaData = String.format("{\n \"compileVersion\": \"%s\",\n \"buildTime\": %d,\n \"hasVespaParent\": %b\n}",
+ String metaData = String.format("{\n \"compileVersion\": \"%s\",\n \"buildTime\": %d,\n \"parentVersion\": %s\n}",
compileVersion,
System.currentTimeMillis(),
- hasVespaParent);
+ parentVersion);
try {
Files.write(applicationDestination.toPath().resolve("build-meta.json"),
metaData.getBytes(StandardCharsets.UTF_8));
