Search code examples
eclipsespringmaven-2m2eclipsetomcat7

Maven filtering (token substitution) in Eclipse (STS) with Tomcat


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 :(


Solution

  • I upgraded to STS 2.8, with the new m2e support, filtering works great, right out of the box-