How-To Guides
Getting Started
Policy Strategies
Format Strings
Extending Antlion
First Tutorial: Simple
Ant Tasks
inner processors
inner repositories
Optional Tasks
About optional tasks

A repository describes how to find a library file based on the entry description. The standard repository (<library-repository>) finds local files inside a directory, based on one or more format strings.

For each library entry, the format strings are searched in-order to find a match. The first file matching will be added. If a format string references attributes that the element doesn't have, then the element is skipped.

Even though format strings can shorten up all the attributes the entries need to provide, you should be cautious how many short-cuts you provide. Some non-obvious situations can arrise where some libraries are never matched, since they repeat a match with another entry that uses a different formatter.

If an entry has the type attribute set to dir, then the repository will ensure that format strings match against a directory; otherwise, the entry must be a file.

If an entry has the location attribute set, then the repository uses that attribute's value as the name of the file on the local file system, and will include it in that repository's results, regardless of the file's existence.

Attribute Description Required

Adds a format string to the repository.


The base directory to look for files matching the formats. The directory specified will be relative to the build's base directory.

No, defaults to the build's base directory

The files in this repository should be considered artifacts. Artifact repositories go under the assumption that the file doesn't have to exist to be a valid repository file; the file might be created during the build. Non-artifact repositories must have the file exist for the format string to be considered a successful match.

If the entry is marked as a directory (type="dir"), then the repository will assume that the directory will be created if it doesn't exist. If the formatter finds a file or directory, but it isn't the expected type, then the formatter will not report a match.

No, defaults to no
if Since Antlion 0.6.0

Only use this repository if the named property is set (regardless of the property's value).
unless Since Antlion 0.6.0

Only use this repository if the named property is not set (regardless of the property's value).

Nested Elements


Adds a format to the repository.

Attribute Description Required

The format text to add.


<library-repository id="3rdparty.repository"
  <format text="[group]/[version]/[artifact]-[version].[type]" />
  <format text="[group]/[version]/[artifact].[type]" />
  <format text="[group]/[version]/[group]-[version].[type]" />
  <format text="[group]/[version]/[group].[type]" />
Finds all libraries from the ${3rdparty.dir} directory matching the above types. Note that with this many formatters, small errors in the lib-entry can cause incorrect file matching.

For instance, with:
<lib-entry group="xdoclet" version="2.0" artifact="unknown" />
Then it will check ${3rdparty.dir}/xdoclet/2.0/unknown-2.0.jar, then ${3rdparty.dir}/xdoclet/2.0/unknown.jar, then ${3rdparty.dir}/xdoclet/2.0/xdoclet-2.0.jar, which will be a match, but probably not the one that the user expected.

Document version $Revision: 1.8 $ $Date: 2005/09/29 21:40:25 $

SourceForge Logo
Copyright © 2004-2006, The Antlion Project