[英]How to remove commented properties from properties file using ant build?
[英]Overwriting properties file during ant build
我正在使用ant作為構建工具的java項目中工作。
我有兩個.property文件,分別是build_local和build_env。 當我通過ant構建項目時,應使用build_local屬性文件,而在為環境構建項目時,應覆蓋build_local並使用build_env。
在此先感謝您的幫助。 如果您可以發布一些參考文獻,那就太好了。
您是否看到過可以將參數傳遞給ant build文件的示例。 如何將參數傳遞給Ant任務?
因此,對於您的本地構建用途
ant -Denv=build_local -f your_antfile.xml
對於非本地文件,請致電
ant -Denv=build_env -f your_antfile.xml
不用說在your_antfile.xml中,您需要將屬性文件引用為“ $ {env} .properties”
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.