diff --git a/pom.xml b/pom.xml index 551b98b0b93a5518f9cb41b2c9f2937abc6f46d3..68d2132e3bcc3c7754dc0d14e8bb3babd32388c2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ dhu personnes.ui - 1.0.2-SNAPSHOT + 2.0.0-SNAPSHOT war personnes.ui @@ -113,8 +113,23 @@ 2.3 false + + + ${project.version} (${maven.build.timestamp}) + + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + ${project.artifactId}-v@{project.version} + true + + + org.apache.maven.plugins maven-dependency-plugin diff --git a/src/main/java/core/web/ImplementationVersionListener.java b/src/main/java/core/web/ImplementationVersionListener.java new file mode 100644 index 0000000000000000000000000000000000000000..d1efcd2fb7e7c0e75d591f9caba16fa726e7aff4 --- /dev/null +++ b/src/main/java/core/web/ImplementationVersionListener.java @@ -0,0 +1,52 @@ +package core.web; + +import java.io.IOException; +import java.io.InputStream; +import java.util.jar.Attributes; +import java.util.jar.Manifest; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.ServletContext; +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; + +/** + * + * @author dominique huguenin (dominique.huguenin AT rpn.ch) + */ +public class ImplementationVersionListener implements ServletContextListener { + + public static final String MANIFEST_IMPLEMENTATION_VERSION = "Implementation-Version"; + + public static final String ATTRIBUT_IMPLEMENTATION_VERSION = "implementationVersion"; + + private static final Logger LOGGER + = Logger.getLogger(ImplementationVersionListener.class.getCanonicalName()); + + @Override + public void contextInitialized(final ServletContextEvent sce) { + ServletContext application = sce.getServletContext(); + InputStream inputStream = application.getResourceAsStream("/META-INF/MANIFEST.MF"); + if (inputStream != null) { + try { + Manifest manifest = new Manifest(inputStream); + Attributes attr = manifest.getMainAttributes(); + String value = attr.getValue(MANIFEST_IMPLEMENTATION_VERSION); + if (value == null) { + value = "INCONNU"; + } + application.setAttribute(ATTRIBUT_IMPLEMENTATION_VERSION, value); + } catch (IOException ex) { + LOGGER.log(Level.SEVERE, null, ex); + application.setAttribute(ATTRIBUT_IMPLEMENTATION_VERSION, "INCONNU"); + } + } else { + application.setAttribute(ATTRIBUT_IMPLEMENTATION_VERSION, "DEV"); + } + } + + @Override + public void contextDestroyed(final ServletContextEvent sce) { + } + +} diff --git a/src/main/webapp/WEB-INF/accueil.jsp b/src/main/webapp/WEB-INF/accueil.jsp index 9916f27d04e8c5b0671ec19ad730203f2bb9ae05..e1b031bb328b13963d8660fab0916f11f8e8c87d 100644 --- a/src/main/webapp/WEB-INF/accueil.jsp +++ b/src/main/webapp/WEB-INF/accueil.jsp @@ -10,5 +10,6 @@

Personnes - Gestion des personnes

+ <%@include file="./jspf/footer.jspf" %> diff --git a/src/main/webapp/WEB-INF/database.jsp b/src/main/webapp/WEB-INF/database.jsp index 21d56b9fdc1e9ea30bb7ceecf215d569c7526a00..0c125ed5bb19ca90ff4bfe2f0738fa1406df4440 100644 --- a/src/main/webapp/WEB-INF/database.jsp +++ b/src/main/webapp/WEB-INF/database.jsp @@ -51,5 +51,7 @@ + <%@include file="./jspf/footer.jspf" %> + diff --git a/src/main/webapp/WEB-INF/erreurException.jsp b/src/main/webapp/WEB-INF/erreurException.jsp index ffaf2c837dfe986622eb2fb398d47127f4d2e55c..4f85e993ea5f299a84d64286e01c44642ff89ef7 100644 --- a/src/main/webapp/WEB-INF/erreurException.jsp +++ b/src/main/webapp/WEB-INF/erreurException.jsp @@ -16,5 +16,6 @@
<%exception.printStackTrace(new PrintWriter(out));%>
+ <%@include file="./jspf/footer.jspf" %> diff --git a/src/main/webapp/WEB-INF/erreurHTTP.jsp b/src/main/webapp/WEB-INF/erreurHTTP.jsp index f324597ad9e8ba5ddfd3ab4ef7e940c91c41ff9d..50ecea3fad354067c219e77649acb866f45c4435 100644 --- a/src/main/webapp/WEB-INF/erreurHTTP.jsp +++ b/src/main/webapp/WEB-INF/erreurHTTP.jsp @@ -18,5 +18,7 @@ + <%@include file="./jspf/footer.jspf" %> + diff --git a/src/main/webapp/WEB-INF/jspf/footer.jspf b/src/main/webapp/WEB-INF/jspf/footer.jspf new file mode 100644 index 0000000000000000000000000000000000000000..5b316235e854c8fb8694749a0a3dbe99e7335891 --- /dev/null +++ b/src/main/webapp/WEB-INF/jspf/footer.jspf @@ -0,0 +1,16 @@ +<%@page import="java.io.InputStream"%> +<%@page import="java.util.jar.Attributes"%> +<%@page import="java.util.jar.Manifest"%> +<%@ page pageEncoding="UTF-8" %><%-- +--%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%-- +--%><%@page language="java" session="true" %><%-- + + +--%> + diff --git a/src/main/webapp/WEB-INF/personnes/detail.jsp b/src/main/webapp/WEB-INF/personnes/detail.jsp index af184ab1f44093004b801b9024fd62404f083266..e81fe449fbea40052333000490e4233fa45aa1a9 100644 --- a/src/main/webapp/WEB-INF/personnes/detail.jsp +++ b/src/main/webapp/WEB-INF/personnes/detail.jsp @@ -85,6 +85,6 @@ + <%@include file="../jspf/footer.jspf" %> - diff --git a/src/main/webapp/WEB-INF/personnes/liste.jsp b/src/main/webapp/WEB-INF/personnes/liste.jsp index 7e2ab84868b4d7d1aa1863809de5ded3d4e13906..ed8177ae50a0002ec2d58739625e00dce3845c86 100644 --- a/src/main/webapp/WEB-INF/personnes/liste.jsp +++ b/src/main/webapp/WEB-INF/personnes/liste.jsp @@ -37,5 +37,6 @@ + <%@include file="../jspf/footer.jspf" %> diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 456dcfd5ca9e45b2a47b8c2ea0db74f169dc1e46..8116d8ab67c254033ecf429414cb5d8176ce0254 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -1,5 +1,8 @@ + + core.web.ImplementationVersionListener + Accueil /WEB-INF/accueil.jsp