Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Encrypting ANT build.xml file

 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic