aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpriyank <priyank.maheshwari@est.tech>2024-10-16 11:59:49 +0100
committermpriyank <priyank.maheshwari@est.tech>2024-10-23 22:55:21 +0100
commitff99139d82e9911e485f228bcd93e0d9b4d6a74b (patch)
tree92aef9fa3c0a6ed03330a4503c9f609f2cbcc89e
parent26559ef91557ae602fc3e8f2304f7bc6c57b6fbb (diff)
Add metadata related to builds and commits
- removing the build-info goal from the existing spring-boot-maven-plugin - adding git-commit-id-maven-plugin to expose the git related info using actuator/info endpoint - adding the dateFormat to git plugin to make it same as the build-info - cleaning up a duplicate dependency in cps-ncmp-rest-stub module Issue-ID: CPS-2445 Change-Id: Id7179a81361718d293b7b31f50c1adbdd2ad4302 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
-rw-r--r--cps-application/pom.xml24
-rw-r--r--cps-application/src/main/resources/application.yml5
-rw-r--r--cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/pom.xml5
-rw-r--r--cps-parent/pom.xml15
4 files changed, 43 insertions, 6 deletions
diff --git a/cps-application/pom.xml b/cps-application/pom.xml
index c37447306c..08c718167e 100644
--- a/cps-application/pom.xml
+++ b/cps-application/pom.xml
@@ -172,6 +172,30 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>io.github.git-commit-id</groupId>
+ <artifactId>git-commit-id-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>get-git-info</id>
+ <goals>
+ <goal>revision</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <dateFormat>yyyy-MM-dd'T'HH:mm:ss.sss'Z'</dateFormat>
+ <includeOnlyProperties>
+ <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
+ <includeOnlyProperty>^git.commit.(id.full|message.short|user.name|user.email)$</includeOnlyProperty>
+ <includeOnlyProperty>^git.branch</includeOnlyProperty>
+ </includeOnlyProperties>
+ <generateGitPropertiesFile>true</generateGitPropertiesFile>
+ <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
+ <commitIdGenerationMode>full</commitIdGenerationMode>
+ </configuration>
+ </plugin>
</plugins>
</build>
<profiles>
diff --git a/cps-application/src/main/resources/application.yml b/cps-application/src/main/resources/application.yml
index 3789e92b08..d7e39f7fae 100644
--- a/cps-application/src/main/resources/application.yml
+++ b/cps-application/src/main/resources/application.yml
@@ -180,6 +180,11 @@ management:
probes:
enabled: true
+ info:
+ git:
+ enabled: true
+ mode: full
+
logging:
format: json
level:
diff --git a/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/pom.xml b/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/pom.xml
index 1fcea8f567..aa7e1fb13a 100644
--- a/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/pom.xml
+++ b/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/pom.xml
@@ -63,11 +63,6 @@
<artifactId>spock-spring</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.spockframework</groupId>
- <artifactId>spock-core</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project> \ No newline at end of file
diff --git a/cps-parent/pom.xml b/cps-parent/pom.xml
index f97a40b223..a83278d6cd 100644
--- a/cps-parent/pom.xml
+++ b/cps-parent/pom.xml
@@ -122,13 +122,26 @@
<executions>
<execution>
<goals>
- <goal>build-info</goal>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
+ <groupId>io.github.git-commit-id</groupId>
+ <artifactId>git-commit-id-maven-plugin</artifactId>
+ <version>9.0.0</version>
+ <executions>
+ <execution>
+ <id>get-git-info</id>
+ <goals>
+ <goal>revision</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>