title: Cannot run server from eclipse with maven filtering application context
body: <p>I am using Spring Tool Suite which is Eclipse-based for my webapp along with Maven Filtering to inject the database credentials into my root context.</p>
  
  <p>My pom.xml contains the following:</p>
  
  <pre><code>&lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;debug&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;environment.type&gt;debug&lt;/environment.type&gt;
  
              &lt;db.driver&gt;com.mysql.jdbc.Driver&lt;/db.driver&gt;
              &lt;db.url&gt;jdbc:mysql://xxx:3306/xxxxx&lt;/db.url&gt;
              &lt;db.username&gt;xxxxxx&lt;/db.username&gt;
              &lt;db.password&gt;xxxxxx&lt;/db.password&gt;
  
              &lt;tomcat.server&gt;xxxxx&lt;/tomcat.server&gt;
              &lt;tomcat.path&gt;/xxxxx&lt;/tomcat.path&gt;
              &lt;tomcat.url&gt;http://xxx:8080/manager/text&lt;/tomcat.url&gt;
              &lt;tomcat.username&gt;xxx&lt;/tomcat.username&gt;
              &lt;tomcat.password&gt;xxx&lt;/tomcat.password&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  ...
  &lt;build&gt;
          &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.4&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;webResources&gt;
                      &lt;resource&gt;
                          &lt;filtering&gt;true&lt;/filtering&gt;
                          &lt;directory&gt;${basedir}/src/main/webapp/WEB-INF&lt;/directory&gt;
                          &lt;targetPath&gt;WEB-INF&lt;/targetPath&gt;
                          &lt;includes&gt;
                              &lt;include&gt;**/root-context.xml&lt;/include&gt;
                          &lt;/includes&gt;
                      &lt;/resource&gt;
                  &lt;/webResources&gt;
              &lt;/configuration&gt;
      &lt;/plugin&gt;
  &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>While my root-context.xml contains the following:</p>
  
  <pre><code>&lt;bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
      destroy-method="close"&gt;
      &lt;property name="driverClass" value="${db.driver}" /&gt;
      &lt;property name="jdbcUrl" value="${db.url}" /&gt;
      &lt;property name="user" value="${db.username}" /&gt;
      &lt;property name="password" value="${db.password}" /&gt;
      &lt;property name="maxIdleTime" value="60" /&gt;
      &lt;property name="idleConnectionTestPeriod" value="55" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I get no issues when I deploy to Tomcat, and similarly, when I build it with Maven my target folder contains the filtered root-context.xml. </p>
  
  <p>However, when I attempt to run this webapp from Eclipse with "Run on Server..." I get the following error:</p>
  
  <pre><code>WARN : com.mchange.v2.c3p0.DriverManagerDataSource - Could not load driverClass ${db.driver}
  java.lang.ClassNotFoundException: ${db.driver}
  </code></pre>
  
  <p>It seems the root-context.xml that gets copied over is unfiltered. Is there a way to fix this? </p>