0

I'm using Maven to build a Spring (3.0.5.RELEASE) project. In my applicationContext.xml I use PropertyPlaceholderConfigurer (to load properties from the DB) like so:

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="properties" ref="configurationConverter"/>
</bean>

The properties I want to access in the DB works fine, but ${project.name} and ${project.version} stops working. Where do these properties come from originally? And most importantly: how can I get them back?

Jonas Byström
  • 25,316
  • 23
  • 100
  • 147
  • Those are properties that are only available during the build with maven. Those are maven specific. Those aren't available when running your application. – M. Deinum Aug 19 '14 at 06:58
  • Are they replaced into text in my `target/` folder when building? – Jonas Byström Aug 19 '14 at 07:16
  • Is this a java project or a web project? What directory contains your applicationContext.xml file? – Steve C Aug 19 '14 at 07:28
  • 1
    If you use the Maven Resources plugin and set filtering=true, then you can replace Maven variables like 'project.version'. See https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html – Richard Neish Aug 19 '14 at 07:34
  • @RichardNeish: put that in an answer and I'll accept it. – Jonas Byström Aug 25 '14 at 11:09

1 Answers1

1

If you use the Maven Resources plugin and set filtering=true, then you can replace Maven variables like 'project.version'. See https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html

Richard Neish
  • 8,414
  • 4
  • 39
  • 69