我正在研究由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项目版本号?
发布评论