From 200b27e03ccb52e9a11e7e687758bcbc73976a27 Mon Sep 17 00:00:00 2001 From: tim holloway Date: Fri, 1 Mar 2024 18:21:14 -0500 Subject: [PATCH] Added version display to layout page footer --- pom.xml | 4 ++-- src/main/java/com/mousetech/gourmetj/AppBean.java | 11 ++++++++++- .../META-INF/resources/WEB-INF/layout/layout.xhtml | 5 +++-- src/main/resources/application.yml | 3 +++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 6a073b2..845e081 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.mousetech.gourmet gourmetj - 0.3.0 + 0.3.1 jar GourmetJ @@ -17,7 +17,7 @@ org.springframework.boot spring-boot-starter-parent - 3.2.2 + 3.2.3 diff --git a/src/main/java/com/mousetech/gourmetj/AppBean.java b/src/main/java/com/mousetech/gourmetj/AppBean.java index 98a3019..2330515 100644 --- a/src/main/java/com/mousetech/gourmetj/AppBean.java +++ b/src/main/java/com/mousetech/gourmetj/AppBean.java @@ -3,6 +3,8 @@ package com.mousetech.gourmetj; import java.util.ArrayList; import java.util.List; +import org.springframework.beans.factory.annotation.Value; + import jakarta.enterprise.context.ApplicationScoped; import jakarta.faces.model.SelectItem; import jakarta.inject.Named; @@ -47,5 +49,12 @@ public class AppBean { new SelectItem(RecipeSearchType.rst_BY_INGREDIENT.ordinal(), "Ingredient")); return list; - } + } + + @Value("${appVersion}") + String appVersion = "Not Supplied."; + + public String getAppVersion() { + return appVersion; + } } diff --git a/src/main/resources/META-INF/resources/WEB-INF/layout/layout.xhtml b/src/main/resources/META-INF/resources/WEB-INF/layout/layout.xhtml index 4240bc4..b14be12 100644 --- a/src/main/resources/META-INF/resources/WEB-INF/layout/layout.xhtml +++ b/src/main/resources/META-INF/resources/WEB-INF/layout/layout.xhtml @@ -18,7 +18,7 @@

- Gourmet Recipe Manager (web version) + Gourmet Recipe Manager (web version #{appBean.appVersion})

@@ -28,10 +28,11 @@
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index d9bee3e..d77b45e 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -21,6 +21,9 @@ spring: ddl-auto: none database-platform: org.hibernate.dialect.MySQLDialect +# From Maven POM: +appVersion: "@project.version@" + # Tracking-modes prevent URL rewrite jsessionid on Primecases # resources. Which causes "400" errors on initial main.jsf fetch. server: