Added git info plugin and footer

This commit is contained in:
Rohan Sircar 2020-07-26 19:59:28 +05:30
parent b9ad037f60
commit 6a7f291e5c
6 changed files with 74 additions and 9 deletions

26
pom.xml
View File

@ -192,6 +192,32 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.1</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
<execution>
<id>validate-the-git-infos</id>
<goals>
<goal>validateRevision</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<excludeProperties>
<excludeProperty>git.user.*</excludeProperty>
</excludeProperties>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -28,7 +28,8 @@ public class BeanConfigurations {
@Bean @Bean
public MessageSource messageSource() { public MessageSource messageSource() {
final ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); final ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
messageSource.setBasenames("classpath:/messages,file:./config/messages"); messageSource
.setBasenames("classpath:/messages,file:./config/messages");
messageSource.setUseCodeAsDefaultMessage(true); messageSource.setUseCodeAsDefaultMessage(true);
messageSource.setDefaultEncoding("UTF-8"); messageSource.setDefaultEncoding("UTF-8");
messageSource.setCacheSeconds(5); messageSource.setCacheSeconds(5);
@ -45,10 +46,4 @@ public class BeanConfigurations {
return keyBasedPersistenceTokenService; return keyBasedPersistenceTokenService;
} }
// @Bean
// public Connection connection() throws SQLException
// {
// return DriverManager.getConnection(url, userName, password);
// }
} }

View File

@ -0,0 +1,22 @@
package org.ros.chatto.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import lombok.Getter;
@Component
@PropertySource(value = "classpath:git.properties")
@Getter
public class BuildInfo {
private final String buildVersion;
private final String branchName;
public BuildInfo(@Value("${git.build.version") String buildVersion,
@Value("${git.branch") String branchName) {
this.buildVersion = buildVersion;
this.branchName = branchName;
}
}

View File

@ -130,6 +130,8 @@
</div> </div>
</div> </div>
</div> </div>
<th:block th:include="fragments/head :: footerFragment"></th:block>
<template id="msg_container_template"> <template id="msg_container_template">
<div class="d-flex justify-content-start mb-4"> <div class="d-flex justify-content-start mb-4">
<div class="img_cont_msg"> <div class="img_cont_msg">

View File

@ -78,6 +78,25 @@
<body> <body>
<th:block th:fragment="footerFragment">
<!-- Footer -->
<footer class="page-footer font-small blue">
<!-- Copyright -->
<div class="footer-copyright text-center py-3">© 2020 Copyright:
Chatto
<div>
Build revision: <div th:text="${@environment.getProperty('git.build.version')}">None
</div>
</div>
from branch <div th:text="${@environment.getProperty('git.branch')}">None</div>
</div>
<!-- Copyright -->
</footer>
<!-- Footer -->
</th:block>
</body> </body>
</html> </html>

View File

@ -12,7 +12,8 @@
<script src="https://code.jquery.com/jquery-2.1.4.min.js" th:if="false"></script> <script src="https://code.jquery.com/jquery-2.1.4.min.js" th:if="false"></script>
<script src="http://blackpeppersoftware.github.io/thymeleaf-fragment.js/thymeleaf-fragment.js" defer="defer" th:if="false"></script> <script src="http://blackpeppersoftware.github.io/thymeleaf-fragment.js/thymeleaf-fragment.js" defer="defer"
th:if="false"></script>
</link> </link>
@ -105,7 +106,7 @@
</div> </div>
</div> </div>
</section> </section>
<th:block th:include="fragments/head :: footerFragment"></th:block>
</body> </body>
</html> </html>