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 {