wood burning stoves*
The moose likes Spring and the fly likes use pom properties in xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "use pom properties in xml" Watch "use pom properties in xml" New topic
Author

use pom properties in xml

Rakesh Basani
Ranch Hand

Joined: Jun 04, 2012
Posts: 38
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

Joined: Mar 07, 2010
Posts: 1646
    
    7

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



[How To Ask Questions][Read before you PM me]
 
jQuery in Action, 2nd edition
 
subject: use pom properties in xml
 
Similar Threads
maven custom archetypes
Ear Building in Maven
Modify build xml to replace words in an xml or properties file based on a text file
Help witn Maven resources tag
How to copy file.jks KEEPING ORIGINAL FILE DATE in maven