You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by tutul <sh...@hotmail.com> on 2008/09/16 15:31:07 UTC

Using filters in pom.xml

Hi,

This question may be answered before but I didn't find it in my search in
the forum. I am trying to apply filters in my project to populate the
datasource.xml file for my project. I think I have the right settings
required in the maven pom.xml because it is successfully applying the
filters in another project, but it is not getting applied.
Ok, let me see if I can explain my problem. 
1) I have a datasource.xml file to specify the driver/url/usernamepassword
etc ...which is in src/main/application folder

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource> 
    <jndi-name>adminDs</jndi-name> 
    <user-name>${admin.db.user}</user-name> 
    <password>${admin.db.password}</password>
    <connection-url>${admin.db.url}</connection-url> 
    <driver-class>${admin.db.driver}</driver-class> 
  </local-tx-datasource> 
</datasources>

2) I have the a dev.properties file which is in src/main/filter folder...
admin.db.user = xyz
admin.db.password = xyzabc
admin.db.url = jdbc:oracle:thin:@zbcafdysd.com:1522:1283bnwseh
admin.db.driver = oracle.jdbc.driver.OracleDriver

3) My pom.xml file has the following...

<build>    
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/application</directory>
      </resource>
    </resources>
       <filters>
          <filter>src/main/filters/dev.properties</filter>
        </filters>
....................
.................
</build>

--------------------------------------------------------
But my filters are not getting applied after I do maven clean install. Just
an FYI, I have some other entries in my dev.properties file which is getting
applied but not the one in datasource.xml file. I am using windows
environment and the same filters get substituted in the unix environment.

Sorry for this long message. Just thought I should explain my problem.

Does anyone knows a solution for this problem. Any help/pointers would be
very helpful

Thanks
-- 
View this message in context: http://www.nabble.com/Using-filters-in-pom.xml-tp19511884p19511884.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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