aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Encrypting ANT build.xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Encrypting ANT build.xml file " Watch "Encrypting ANT build.xml file " New topic
Author

Encrypting ANT build.xml file

Tuna Töre
Ranch Hand

Joined: Aug 17, 2008
Posts: 219

I would like to encrypt build.properties file and use the password stored inside for my build.xml file.?

I would like to enter the database password inside build.properties file and use it by decrypting it using ANT ?

Thanks


Tuna TÖRE


blog: http://tunatore.wordpress.com
SCJP 6.0 + SCWCD 1.5
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16137
    
  21

For ant to be able to read and execute an encrypted build.xml you'd either need to store build.xml in an encypted filesystem or modify Ant so that it could decrypt build.xml.

Realistically, it's better just to hide the password someplace where it can't be seen by casual viewers and pass it in as an externally-supplied property. You could also make the Ant script prompt for a password, but as a rule, Ant scripts should avoid being interactive.


Customer surveys are for companies who didn't pay proper attention to begin with.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Why not write an ant task that will decrypt an encrypted password?

I just googled and found this task: http://massdosage.co.za/tech/java/ant/index.html


JBoss In Action
Tuna Töre
Ranch Hand

Joined: Aug 17, 2008
Posts: 219

Tim Holloway wrote:For ant to be able to read and execute an encrypted build.xml you'd either need to store build.xml in an encypted filesystem or modify Ant so that it could decrypt build.xml.

Realistically, it's better just to hide the password someplace where it can't be seen by casual viewers and pass it in as an externally-supplied property. You could also make the Ant script prompt for a password, but as a rule, Ant scripts should avoid being interactive.


Thanks I think you are right. it would be better to get it with an enternally-supplied property or I can use prompts.

Tuna TÖRE
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Encrypting ANT build.xml file