This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes How to edit xml or propeties file manually by the use of ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to edit xml or propeties file manually by the use of ant" Watch "How to edit xml or propeties file manually by the use of ant" New topic
Author

How to edit xml or propeties file manually by the use of ant

Sujeet Kumar Singh
Greenhorn

Joined: Apr 13, 2011
Posts: 1
Dear All,

How to edit xml or propeties file manually by the use of ant.

Please share with examples and steps for the same.

Thanks in advance,

Sujeet Kumar Singh
Phani Raju
Greenhorn

Joined: Aug 03, 2007
Posts: 19
Take a look at the below tasks available in Ant:

  • PropertyFile
  • Replace
  • ReplaceRegExp


  • Post back if you get any issues while using these.
    Peter Johnson
    author
    Bartender

    Joined: May 14, 2008
    Posts: 5838
        
        7

    Here is what I do. I create my xml and properties files with embedded EL-style property references, such as ${something}. Then in my Ant script I make sure that I define the "something" property, and I use the copy task with the filterchain/expandproperties setting. Also check into the other filterchain options.


    JBoss In Action
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: How to edit xml or propeties file manually by the use of ant