7.5 Configuring the Provisioning Repository

The locations which the SpringSource dm Server will include in its provisioning repository can be configured by editing the server.config file in the SERVER_HOME/config directory. The default locations are implied, rather than being explicitly defined in the configuration file. The default configuration is equivalent to the following node in the configuration file:

"provisioning" : {
    "searchPaths": [
        "repository/bundles/subsystems/{name}/{bundle}.jar",
        "repository/bundles/ext/{bundle}",
        "repository/bundles/usr/{bundle}",
        "repository/libraries/ext/{library}",
        "repository/libraries/usr/{library}"
    ]
}

This default configuration has five paths, each of which will be searched when locating entries for inclusion in the provisioning repository. The repository/bundles/subsystems/{name}/{bundle}.jar, repository/bundles/ext/{bundle}, and repository/libraries/ext/{library} are all required by a default installation and should always be included in a custom configuration.

7.5.1 Search Paths

Each search path defines a location that is included in that SpringSource dm Server's provisioning repository and will therefore be searched when looking for a library or bundle dependency. If a search path is relative its location is taken as being relative to the root of the installation, i.e. the SERVER_HOMEdirectory.

7.5.1.1 Wildcards

Search paths provide support for wildcards. In the entries above, the path segments surrounded by curly braces, e.g. {bundle} and {library}, are wildcards entries for a directory with any name. Allowing wildcards to be named in this way is intended to improve the readability of search path configuration.

In addition to supporting the above-described form of wildcards, SpringSource dm Server also supports Ant-style paths, i.e. * and ** can be used to represent any directory and any series of directories respectively. For example, repository/bundles/usr/{bundle} and repository/bundles/usr/* are directly equivalent.

A common usage of the ** wildcard is to allow dependencies stored in a directory structure of varying depth, e.g. a local Maven repository, to be provisioned by the SpringSource dm Server.

7.5.1.2 System properties

In addition to support for wildcards, system properties can also be used within a search path. System properties are referenced as ${system.property.name}, e.g. a search path of ${user.home}/repository/bundles will reference the repository/bundles directory in the user's home directory.

7.5.2 Example configurations

The following examples provide sample configuration that could be used for some common use cases.

7.5.2.1 Replace bundles/usr with an Ivy cache

"provisioning" : {
    "searchPaths": [
        "repository/bundles/subsystems/{name}/{bundle}.jar",
        "repository/bundles/ext/{bundle}",
        "${user.home}/.ivy2/cache/{org}/{name}/{version}/{bundle}.jar",
        "repository/libraries/ext/{library}",
        "repository/libraries/usr/{library}"
    ]
}

7.5.2.2 Replace bundles/usr with a Maven local repository

"provisioning" : {
    "searchPaths": [
        "repository/bundles/subsystems/{name}/{bundle}.jar",
        "repository/bundles/ext/{bundle}",
        "${user.home}/.maven/repository/**/{bundle}.jar",
        "repository/libraries/ext/{library}",
        "repository/libraries/usr/{library}"
    ]
}