From f40367439e3697f52b2e3c104072d7904e5f8cbf Mon Sep 17 00:00:00 2001 From: Bernd Ahlers Date: Mon, 16 Jun 2025 20:08:26 +0200 Subject: [PATCH] Handle the "jvm_version" manifest attribute --- manifest/manifest.go | 1 + project/project.go | 2 ++ xmltemplate/xmltemplate.go | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/manifest/manifest.go b/manifest/manifest.go index 984e0dc..12e4521 100644 --- a/manifest/manifest.go +++ b/manifest/manifest.go @@ -13,6 +13,7 @@ import ( const DownloadedManifestPrefix = "downloaded-manifest" type Manifest struct { + JVMVersion int `json:"jvm_version,omitzero"` Modules []ManifestModule `json:"modules"` Includes []string `json:"includes,omitempty"` DefaultApply ManifestApply `json:"default_apply,omitempty"` diff --git a/project/project.go b/project/project.go index c07a25c..cf2f9f4 100644 --- a/project/project.go +++ b/project/project.go @@ -20,6 +20,7 @@ type Project struct { Server Module Modules []Module AssemblyPlatforms []string + JVMVersion int } type Apply struct { @@ -276,6 +277,7 @@ func New(config config.Config, manifestFiles []string, options ...projectOption) Server: server, Modules: projectModules, AssemblyPlatforms: readManifest.AssemblyPlatforms, + JVMVersion: readManifest.JVMVersion, } return project diff --git a/xmltemplate/xmltemplate.go b/xmltemplate/xmltemplate.go index 6f95012..ba4a2d2 100644 --- a/xmltemplate/xmltemplate.go +++ b/xmltemplate/xmltemplate.go @@ -18,6 +18,7 @@ type TemplateInventory struct { Dependencies []p.Module Assemblies map[string][]Assembly AssemblyPlatforms []string + JVMVersion int } type Assembly struct { @@ -75,12 +76,14 @@ func WriteXmlFile(config config.Config, project p.Project, templateFile string, Dependencies: p.MavenDependencies(project), Assemblies: mavenAssemblies(project), AssemblyPlatforms: project.AssemblyPlatforms, + JVMVersion: project.JVMVersion, } var buf bytes.Buffer if err := tmpl.Execute(&buf, &inventory); err != nil { - logger.Fatal("Unable to execute template: %v", err) + logger.Error("Unable to execute template: %v", err) + logger.Fatal("Please make sure you are running the latest version. Use the `self-update` command to update the CLI.") } if err := os.WriteFile(outputFile, buf.Bytes(), 0644); err != nil {