我有一个包含此资源的context.xml文件:
<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"/>
并且在处理webapp资源时maven-war-plugin过滤该文件:
<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>
结果是:
<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"/>
未过滤URL部分,因为“@”被解释为分隔符。 Delimiter param可以为maven-resources-plugin定制,但我不知道如何为maven-war-plugin做这个!
请帮忙!
答案 0 :(得分:0)
尝试转发像\@