Read property file in ant build.xml




















Add a comment. Active Oldest Votes. This should be all you need to do: 1. Improve this answer. Perception Perception Just imagine, property on was defined in build. I will update my answer to include this information. Seems to me that you want to implement something like below given task. Vijay Shanker Dubey Vijay Shanker Dubey 4, 6 6 gold badges 27 27 silver badges 47 47 bronze badges.

But i have still problem. If you don't want to write your own Ant Task or use other libs, just "clean" ant, have a look at this one: mybuild. Daniel Daniel 2, 1 1 gold badge 18 18 silver badges 21 21 bronze badges.

I m going forward with my project! Andreas Dolk Andreas Dolk k 16 16 gold badges silver badges bronze badges. Why would you need to do this when you can import a properties file in an Ant script? Perception - why don't you make an answer from this valuable information? Custom ant tasks is definitely more fun : — Andreas Dolk. I've submitted an answer, as humbly requested :- — Perception.

Sign up or log in Sign up using Google. Sign up using Facebook. It looks at the files previously published. Improve this answer. Thank you for your big and detailed answer. Very good example and if someday I decide to learn ivy I will definitely use it. But for now my question is not so advanced. I just needed to resolve file path. And I really din't want to plugin ivy because it's another thing to learn.

Is it possible just with ant to resolve path relatively to loaded file? Checkout the "Resolving files against the imported file" section in the import task docs: ant. That's where I come from. Based on yours and Ralfs answers I guess what I want is not possible. Thanx again for your time and very complete answer.

A simple approach would be the following: In the build. Ralf Wagner Ralf Wagner 1, 9 9 silver badges 14 14 bronze badges. I thought I can somehow tell ant to resolve location relatively to file where this property is defined.

It's sad that I can't. Thank you anyway. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked 2. Related 1. There is no hard and fast rule, but typically the property file is named as build. You could create multiple build properties files based on the deployment environments - such as build.

The contents of the build property file are similar to the normal java property file. They contain one property per line. Each property is represented by a name and a value pair. It is highly recommended that the properties are annotated with proper comments. Comments are listed using the hash character. The following example shows a build.

In the above example, sitename is a custom property which is mapped to the website name. You can declare any number of custom properties in this fashion.



0コメント

  • 1000 / 1000