Projects, resources and modules can be associated with multiple types. The combination of a resource group, name, type and version is used to construct an artifact uri.
One or more type declarations may be added within an enclosing <types> element. The nested <type> element declares the type name under the id attribute. Optional properties may be declared as nested <property> elements.
The jar type is given special consideration when constructing classpath information. If a project is declared as a dependency of another project and that project declares that it is a jar type, then the referenced projects will be included in classpath constuction.
The following attributes may be declared on a <type> element.
id | The type identifier (required). |
version | Declaration of an link-based alias version If declared a link will be created with a version corresponding to the supplied value (a version in the form <major>.<minor> e.g. as 1.2. |
alias | Declaration of an an un-versioned link (may not be used in conjunction with the version attribute). |
property | 0..n | Declaration of one or more properties associated with the type. |
The following resource definition declares a single type with an id of "jar".
<resource name="ant-junit"> <types> <type id="jar"/> </types> <dependencies> <runtime> <include key="ant"/> <include ref="junit/junit"/> </runtime> </dependencies> </resource>
The following project definition contains multiple type declarations. In this example the <part:plugin> type declaration is a case of a custom type defintion that extends the generic type element.
<project name="dpml-metro-runtime" basedir="runtime"> <info title="Metro Container Runtime"> <description> DPML Component management platform runtime container. </description> </info> <types> <type id="jar"/> <part:plugin alias="true" class="net.dpml.metro.runtime.CompositionController"> <part:param class="net.dpml.component.InitialContext"/> </part:plugin> </types> <dependencies> <runtime> <include ref="dpml/util/dpml-logging-api" tag="public"/> <include ref="dpml/metro/dpml-metro-component" tag="protected"/> <include ref="dpml/metro/dpml-metro-model" tag="protected"/> <include ref="dpml/metro/dpml-job-impl"/> <include ref="dpml/metro/dpml-state-impl"/> </runtime> <test> <include ref="ant/ant-junit"/> </test> </dependencies> <filters> <feature token="PART-HANDLER-URI" id="uri" type="part"/> <feature token="STATE-XSD-URI" id="uri" type="xsd" ref="dpml/metro/dpml-state" alias="true"/> <feature token="PART-XSD-URI" id="uri" type="xsd" ref="dpml/metro/dpml-metro-part" alias="true"/> <feature token="TYPE-XSD-URI" id="uri" type="xsd" ref="dpml/metro/dpml-type" alias="true"/> <feature token="COMPONENT-XSD-URI" id="uri" type="xsd" ref="dpml/metro/dpml-component" alias="true"/> </filters> </project>