From 2e19e8e48d6ecd6563ed1e85109c4af3f15f2438 Mon Sep 17 00:00:00 2001 From: raksit31667 Date: Wed, 1 Sep 2021 00:01:33 +0700 Subject: [PATCH] :chart_with_upwards_trend: expose app info and version on actuator info endpoint using Gradle property expansion --- api-service/build.gradle | 7 +++++++ api-service/src/main/resources/application.yaml | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/api-service/build.gradle b/api-service/build.gradle index 50ac149..34d17f0 100644 --- a/api-service/build.gradle +++ b/api-service/build.gradle @@ -18,6 +18,7 @@ buildscript { } apply plugin: 'org.springframework.boot' +apply plugin: 'java' apply plugin: 'checkstyle' apply plugin: 'pmd' apply plugin: 'io.spring.dependency-management' @@ -49,6 +50,12 @@ dependencies { annotationProcessor 'org.projectlombok:lombok:1.18.12' } +processResources { + filesMatching('application.yaml') { + expand(project.properties) + } +} + testSets { integrationTest { dirName = 'integration-test' diff --git a/api-service/src/main/resources/application.yaml b/api-service/src/main/resources/application.yaml index abc7c40..7b0e6a4 100644 --- a/api-service/src/main/resources/application.yaml +++ b/api-service/src/main/resources/application.yaml @@ -17,4 +17,13 @@ management: include: '*' metrics: tags.*: - service: template \ No newline at end of file + service: template + +info: + application: + name: ${rootProject.name} + version: ${version} + jdk: + version: \${java.version} + spring-boot: + version: ${springBootVersion}