使用 Tomcat 在 Eclipse (STS) 中进行 Maven 过滤(令牌替换)
我基本上有与这里完全相同的问题:
http://stackoverflow.com/questions/2416155/issue-in-executing-spring-web-project-in-eclipse-on-tomcat-server
但该问题的修复不起作用。我的 pom.xml 中有属性,
<properties>
<build.cmsBaseUrl>setineclipsebuildprofile</build.cmsBaseUrl>
</properties>
我可以从 eclipse 构建配置文件中设置这些属性(或者直接在 pom.xml 中设置,这不是问题的根源)。该属性会自动替换在我的 java 资源文件夹中的属性文件中,例如
server.environment.cmsBaseUrl=${build.cmsBaseUrl}/
,当使用 maven 构建并手动部署到 Tomcat 时。但是,如果我在 Eclipse (STS) 内部使用 Tomcat,则不会发生替换。我
war:inplace
按照其他答案的说明添加,但仍然没有替换:(
I basically have the exact same problem as here:
http://stackoverflow.com/questions/2416155/issue-in-executing-spring-web-project-in-eclipse-on-tomcat-server
but the fix for that question doesn't work. I have properties in my pom.xml, like
<properties>
<build.cmsBaseUrl>setineclipsebuildprofile</build.cmsBaseUrl>
</properties>
which i can set from the eclipse build profiles (or directly in pom.xml it's not the source of the problem). That property is automatically substituted in properties files in my java resources folder, e.g.
server.environment.cmsBaseUrl=${build.cmsBaseUrl}/
when built with maven and deployed manually to Tomcat. But if I'm using Tomcat internally within Eclipse (STS) that substitution doesn't take place. I added
war:inplace
as per the other answer's instructions, but still no substitution :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我升级到 STS 2.8,有了新的 m2e 支持,过滤效果很好,开箱即用 -
I upgraded to STS 2.8, with the new m2e support, filtering works great, right out of the box-