The moose likes Ant, Maven and Other Build Tools and the fly likes build.properties - to have or not to have Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "build.properties - to have or not to have" Watch "build.properties - to have or not to have" New topic
Author

build.properties - to have or not to have

Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9001
Some people put all their properties into a build.properties file. Others declare all their properties in the build.xml file.

I'm wondering what are some of the pros and cons for using a properties file?


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Gregg Bolinger
Sheriff

Joined: Jul 11, 2001
Posts: 15040

The only thing I can think of is if you have multiple people working on a project there might be common properties in the build.xml but then each developer might have his own set of properties for specific tasks for testing and what not.
Other than that, to remove clutter from the main build.xml maybe??


My Blog | DZone Articles
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
I've developed several detailed build.xml scripts, one for stand-alone projects, and one for web apps. When I start a new project, all I have to do is customize a few parameters in the build.properities file for that new project, and I never have to edit my build.xml file. That makes it easy to maintain a small group of build.xml scripts and just customize a single file with a few properties for each new project.
[ April 25, 2004: Message edited by: Rob Ross ]

Rob
SCJP 1.4
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9001
Rob, Could you give me an idea of which properties you keep in the properties file and which you keep in the build.xml file?
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9001
Have you ever been in a situation where you were unable to modify your development environment i.e. unable to set JBOSS_HOME for example?
bas duijzings
Ranch Hand

Joined: Apr 07, 2004
Posts: 83
hi,
think about the following scenario. When you build an ear files for an environment called systemtest you may want to set different properties then when you build an ear for an environment like production. Think about variables for jdbc/oracle connections for instance that are different.
Then when starting the build you can specify which properties file you want to use.
regards,
baz


have a nice one
 
IntelliJ Java IDE
 
subject: build.properties - to have or not to have
 
Threads others viewed
How can I de-hard code these values in my build.xml script?
ant build files and where to put them
Not the same Ant GUI app question
Can't ant build a component due to ?faulty? build.xml file.
How to get name of property file...???
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture