A resource is the definition of something that has a name, is associated with a namespace (via its enclosing module), has zero or more dependencies, and is something that contributes the definition of other resources and projects.
An example of a resource is the Ant build system. Ant is composed of a number of jar files. You can consider each jar file as a resource within the ant module. When resources such as Ant's ant-junit jar are referenced by other projects, there is an implicit dependency on the underlying ant jar file and the JUnit project's junit jar file. In addition, the Ant jar has an implicit dependency on the ant-launcher jar file. In effect - the pupose of a resource is to make implicit dependencies explicit so that downstream users of these resources pickup a computationally complete definition.
The following attributes may be declared under a <resource> element.
name | The resource name (required). |
version | The resource version (normally declared at module level). |
basedir | Optional declaration of a basedir (used to declare a local directory of a project built by an external process) - typically not used outside of the DPML bootstrap procedure. |
info | 0..1 | Declaration of supplimentary human readable info about the resource. |
properties | 0..1 | Declaration of a set of properties associated with the resource. |
types | 0..1 | A collection of types associated with the resource (e.g. a jar file or a plugin definition). |
dependencies | 0..n | A collection of dependencies that the resource has with other resources. |
The following example resources are from the ant module definition. The version declared within the enclosing module establishes the default version for all resources within the module.
<module name="ant" version="1.6.5" basedir="ant"> <properties> <property name="project.publisher.name" value="Apache Software Foundation"/> <property name="project.specification.vendor" value="${project.publisher.name}"/> <property name="project.implementation.vendor" value="${project.publisher.name}"/> <property name="project.implementation.vendor-id" value="org.apache"/> <property name="project.publisher.url" value="http://www.apache.org"/> <property name="project.resource.host" value="http://repository.dpml.net/"/> <property name="project.api.host" value="http://api.dpml.net"/> </properties> <types> <type id="module" alias="true"/> </types> <resource name="ant"> <properties> <property name="project.api.root" value="${project.api.host}/${project.group}/${project.version}"/> </properties> <types> <type id="jar"/> </types> <dependencies> <runtime> <include key="ant-launcher"/> <include key="ant-trax"/> <include key="ant-xslp"/> </runtime> </dependencies> </resource> <resource name="ant-junit"> <types> <type id="jar"/> </types> <dependencies> <runtime> <include key="ant"/> <include ref="junit/junit"/> </runtime> </dependencies> </resource> <resource name="ant-xslp"> <types> <type id="jar"/> </types> <dependencies> <runtime> <include key="ant"/> </runtime> </dependencies> </resource> <resource name="ant-trax"> <types> <type id="jar"/> </types> <dependencies> <runtime> <include key="ant"/> </runtime> </dependencies> </resource> <resource name="ant-launcher"> <types> <type id="jar"/> </types> </resource> </module>