private void addBuildMetaData(File applicationDestination) throws MojoExecutionException {
        if ( ! applicationDestination.exists()) return;

        if (vespaversion == null)
            vespaversion = project.getPlugin("com.yahoo.vespa:vespa-application-maven-plugin").getVersion();

        Version compileVersion = Version.from(vespaversion);
        if (compileVersion.isSnapshot()) return;

        MavenProject current = project;
        while (current.getParent() != null && current.getParent().getParentArtifact() != null)
            current = current.getParent();

        Version parentVersion = null;
        Artifact parentArtifact = current.getParentArtifact();
        if (parentArtifact != null && isVespaParent(parentArtifact.getGroupId())) {
            try {
                parentVersion = Version.from(parentArtifact.getSelectedVersion().toString());
            } catch (ArtifactResolutionException e) {
                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("""
                                        {
                                          "compileVersion": "%s",
                                          "buildTime": %d,
                                          "parentVersion": %s
                                        }
                                        """,
                                        compileVersion,
                                        System.currentTimeMillis(),
                                        parentVersion == null ? null : "\"" + parentVersion + "\"");
        try {
            Files.writeString(applicationDestination.toPath().resolve("build-meta.json"), metaData);
        }
        catch (IOException e) {
            throw new MojoExecutionException("Failed writing compile version and build time.", e);
        }
    }
Writes meta data about this package if the destination directory exists.
vespa-application-maven-plugin/src/main/java/com/yahoo/container/plugin/mojo/ApplicationMojo.java