如何在jsp页面中获取maven项目版本号?

编程入门 行业动态 更新时间:2024-10-09 12:25:25
本文介绍了如何在jsp页面中获取maven项目版本号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在研究由maven2管理的java Web应用程序。我们不时做了一些更改,并希望做新版本,当然还有新的版本号。在主页(jsp)中,有文字如

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 homepage (jsp), there is text like

<b>version:</b> 2.3.3...

是否有可能,每次我发布新版本时,我只会更改pom.xml中的< version /> ,jsp中的版本号可以由此maven $ {project.version}自动填充?

Is it possible, every time I do a new release, I only change the <version/> in pom.xml, and version number in jsp can be automatically filled by this maven ${project.version}?

我试过maven个人资料,但它似乎没有用。

I tried maven profile, however it doesn't seem to work.

任何想法?

谢谢。

推荐答案

这可能是愚蠢但我会使用。属性文件,如此示例而不是直接过滤JSP。

It's maybe stupid but I'd use a .properties file like in this example instead of filtering directly the JSP.

更多推荐

如何在jsp页面中获取maven项目版本号?

本文发布于:2023-11-12 02:17:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580219.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:版本号   页面   项目   如何在   jsp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!