我有以下replacefilter:
<replacefilter>
<replacetoken><![CDATA[JDBCDataSource="xyz"]]></replacetoken>
<replacevalue><![CDATA[JDBCDataSource="abc"]]></replacevalue>
</replacefilter>
如何从replacetoken和replacevalue标记中的build.properties文件中传递变量,例如:
<replacefilter>
<replacetoken><![CDATA[JDBCDataSource="${var1}"]]></replacetoken>
<replacevalue><![CDATA[JDBCDataSource="${var2}"]]></replacevalue>
</replacefilter>
答案 0 :(得分:1)
您需要使用expandproperties
属性:
<replacefilter>
<replacetoken expandproperties="true"><![CDATA[JDBCDataSource="${var1}"]]></replacetoken>
<replacevalue expandproperties="true"><![CDATA[JDBCDataSource="${var2}"]]></replacevalue>
</replacefilter>