-1
In the Java Web project with Spring MVC framework has the file pom.xml
and within this file has several properties, among these properties has the version of the project: <version>0.0.1-SNAPSHOT</version>
This version of the project is inside the file pom.xml
sort of like this
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.meuprojetojavaweb</groupId>
<artifactId>MeuProjeto</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>MeuProjeto</name>
...
</project>
And I need to show this version of the project directly on a web page .JSP
, preferably in the footer of all pages. Cool as in the code below:
index.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/bootstrap/css/bootstrap.min.css">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
<footer class="main-footer">
<div class="pull-right hidden-xs">
<b>Version</b> {project.version}
</div>
<strong>Copyright © 2017 <a href="#">MeuProjeto</a>.</strong> Todos os direitos reservados.
</footer>
</body>
Where is the "code" {project.version}
would be where it fetches the version of the project that is registered in the file pom.xml
.
So I ask for help here, because I do not know how to proceed and show the version of my project.