5.1.1.7. Property Files
<propertyFiles> is a sub element of <personel-iom-project> and acts as a collection of <propertyFile> elements.
With <propertyFiles> you are able to include files with properties. These properties may be useful to save local resource paths.
1<personal-iom-project>
2 ...
3
4 <propertyFiles>
5 <propertyFile filepath="path/to/property/files" ignoreMissing="false" ></propertyFile>
6 </propertyFiles>
7
8 ...
9</personel-iom-project>
Potential content of a property file
#path to parent folder
output.path=../parent-path
#path to some library
lib1.path=../../some-shared-library
Attributes
There are no attributes for <propertyFiles/>.
Sub elements
Name |
Details |
Attributes |
Number |
---|---|---|---|
propertyFile |
Path to the property file |
filePath, Required ignoreMissing, Optional |
0-n |
5.1.1.7.1. Example
Listing 5.10 shows a project file metafactory.xml that defines a file ‘local.properties’ in the propertyFiles element.
The file local.properties brings some properties that are used in the project together. A programmer can alter these properties for personal use without having to change the project file.
1<personal-iom-project>
2 ...
3
4 <!--Project properties placed in local.properties so these are editable for the programmer.-->
5 <propertyFiles>
6 <propertyFile filepath="local.properties"/>
7 </propertyFiles>
8
9 ...
10</personel-iom-project>
The file local.properties for the example above could contain the following:
#output path used in metafactory.xml to specify path for created java files, xml files and other files
output.path=../test-application # my test output directory.
#output.path=../hours-administration
The properties defined in the ‘local.properties’ are reachable via the variable project.property. For the output path this would be ${project.property.output.path}