diff options
author | jonmv <venstad@gmail.com> | 2022-04-25 09:12:36 +0200 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2022-04-25 09:12:36 +0200 |
commit | e8dc549e56a5fbd7d72ee855f7e481ee42e1abe7 (patch) | |
tree | 614153d49bf5b1a17051bac4b8f33fd0e63c595b | |
parent | 42dfc8a672fa4e088246fd8d7430a61b724bcbdf (diff) |
Pass parent version, rather than just whether there was a vespa parent
-rw-r--r-- | vespa-application-maven-plugin/src/main/java/com/yahoo/container/plugin/mojo/ApplicationMojo.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/vespa-application-maven-plugin/src/main/java/com/yahoo/container/plugin/mojo/ApplicationMojo.java b/vespa-application-maven-plugin/src/main/java/com/yahoo/container/plugin/mojo/ApplicationMojo.java index 6fdcf6efe87..b3fd107631b 100644 --- a/vespa-application-maven-plugin/src/main/java/com/yahoo/container/plugin/mojo/ApplicationMojo.java +++ b/vespa-application-maven-plugin/src/main/java/com/yahoo/container/plugin/mojo/ApplicationMojo.java @@ -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)); |