Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

copy environment specific property files using ant  RSS feed

 
nlr reddy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to copy property files to their right environment using ant.

Suppose, I have three files like below

jsp-dev.properties, jsp-test.properties, jsp-prod.properties.

Now, I would like my ant script to copy right file to the right environment.

if I give env in build.properties as dev, it should trim "-dev" from the file and copy the file to dev.
like copy jsp-dev.properties to jsp.properties and push to dev environment.

Can anyone help me here?

Thanks,
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37381
531
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the <propertyRegexp> task in Ant Contrib. it lets you grab regular expressions from a property. Which means you can search for dev, store it in another property and replace it with an empty string.
 
nlr reddy
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Take a look at the <propertyRegexp> task in Ant Contrib. it lets you grab regular expressions from a property. Which means you can search for dev, store it in another property and replace it with an empty string.


thanks.

I have used mapper to rename and copy the file.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!