maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jamie Bisotti (JIRA)" <j...@codehaus.org>
Subject [jira] Created: (MNG-300) Load .properties files and perform property substitution in pom.xml, etc.
Date Tue, 12 Apr 2005 15:20:15 GMT
Load .properties files and perform property substitution in pom.xml, etc.
-------------------------------------------------------------------------

         Key: MNG-300
         URL: http://jira.codehaus.org/browse/MNG-300
     Project: m2
        Type: Wish
  Components: maven-core  
 Environment: Any
    Reporter: Jamie Bisotti


I'm looking for something like Springs, PropertyPlaceholderConfigurer in pom.xml (or any other
Maven config file).

jdbc.properties snippet:
database.connection.url=SOME_JDBC_CONNECTION_URL


Spring's applicationContext.xml snippet:
<!--
    Configurer that replaces ${...} placeholders in this config file with values from properties
files.
-->
<bean id="propertyConfigurer"
      class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
>
    <property name="locations">
        <list>
            <value>classpath:jdbc.properties</value>
            <value>classpath:hibernate.properties</value>
        </list>
    </property>
</bean>

<bean id="dataSource"
      class="org.springframework.jdbc.datasource.DriverManagerDataSource"
>
    <property name="url">
        <value>${database.connection.url}</value>
    </property>
</bean>

The PropertyPlaceholderConfigureer reads in the specified properties files and makes their
contents available as replacement values throughout the rest of the config file.  This is
very handy, and something that seems to be missing from Maven 1.x.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Mime
View raw message