Question

I have a context.xml file containing this resource :

<Resource name="${jndi.name}" auth="Container"
          type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
          url="jdbc:oracle:thin:@${db.server}:${db.port}:${db.name}"
          username="${db.user}" password="${db.pwd}" maxActive="500" maxIdle="60"
          maxWait="-1"/>

and while processing webapp resources maven-war-plugin filter that file :

<plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <dependentWarExcludes>WEB-INF/lib/*.jar,**/web.xml</dependentWarExcludes>
          <webResources>
            ....
            <resource>
              <directory>src/main/webapp/META-INF</directory>
              <targetPath>META-INF</targetPath>
              <filtering>true</filtering>
            </resource>
            ....
          </webResources>
        </configuration>
      </plugin>

and the result is :

<Resource name="myjndiname" auth="Container"
          type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
          url="jdbc:oracle:thin:@${db.server}:${db.port}:${db.name}"
          username="user" password="pass" maxActive="500" maxIdle="60"
          maxWait="-1"/>

the URL part is not filtered, as '@' is interpreted as a delimiter. Delimiter param can be customized for maven-resources-plugin but i have no idea how to do it for maven-war-plugin !

Please help !

Was it helpful?

Solution

Try escaping the at-sign like \@

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top