Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

use pom properties in xml

 
Rakesh Basani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

How can I use pom properties or system properties in xml files using ${ } notation.
I have a property called CONF_PATH in pom. I am using that in ReloadableResourceBundleMessageSource's value tag...

<value>file:${CONF_PATH}</value>

But it is not working.. Please help me out..

In pom.. I used <resources> tag

<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>

My xml file is in src/main/resources folder


Thanks in advance,
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags

Use the PropertyPlaceholderConfigurer

see the reference documentation
http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/beans.html#beans-factory-placeholderconfigurer

To inject system properties you can use this notation with SPEL



or


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic