4.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.

Listing 4.9 <propertyFiles/> syntax
1
2
3
4
5
6
7
8
9
<personal-iom-project>
        ...

        <propertyFiles>
                <propertyFile filepath="path/to/property/files" ignoreMissing="false" ></propertyFile>
        </propertyFiles>

        ...
</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

Table 4.10 <propertyFiles/> sub elements

Name

Details

Attributes

Number

propertyFile

Path to the property file

filePath, Required

ignoreMissing, Optional

0-n

4.1.1.7.1. Example

Listing 4.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.

Listing 4.10 <propertyFiles/> in project file
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<personal-iom-project>
        ...

                <!--Project properties placed in local.properties so these are editable for the programmer.-->
                <propertyFiles>
                        <propertyFile filepath="local.properties"/>
                </propertyFiles>

        ...
</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}