How can I in a jsp page get maven project version number?

后端 未结 11 2241
天命终不由人
天命终不由人 2020-12-14 16:07

I am working on a java web application, managed by maven2. From time to time, we did some changes, and want to do new releases, of course with new version number. In the hom

11条回答
  •  感动是毒
    2020-12-14 16:55

    I use this plugin,

    http://code.google.com/p/maven-substitute-plugin/

    You can do something like this in Java,

       public final static String projectVersion = "@PROJECT_VERSION@";
    

    and it's trivial to pass this value to JSP.

提交回复
热议问题