The contents of this document are a work in progress

Javadoc Tags used by Plexus tools

Here is a reference of the Javadoc annotations that can be used to 'decorate' the Java sources to allow Plexus tools like Component Descriptor Creator (CDC) to generate Component Descriptors.

Tag/Annotation Available on Required Descriptor Element
@plexus.component Class Yes Indicate to Plexus CDC that the class is a component
@plexus.configuration Field No Tell Plexus CDC that this item should be configured through the components.xml
@plexus.requirement Field No Indicate to Plexus CDC that the field is required by the component


The @plexus.component tag is used to show that the class it annotates is a plexus component. This will add a <component> element to the <components> in components.xml. The following parameters are available, but remember the role is required. The text in the javadoc tag describing this class is copied into the component's <description> tag.

Parameter Required Description
role Yes The role that this class provides an implementation for (usually the class name of an implemented Interface
role-hint No The hints are used to differentiate multiple implementations of the same role
version No Set the version of the component


The @plexus.configuration tags are used to mark fields in a class for configuration through the components.xml.

Parameter Required Description
default-value Currently The default values are currently required for the <configuration> tag to be written to components.xml.


Tagging a field with @plexus.requirement will tell plexus to inject the required component or list of components before the component itself is started. Fields can be of the type of the Interface defining the component you wish to be injected or of type java.util.List or java.util.Map.

Fields of type java.lang.List will have a list of components injected whereas a field of type java.lang.Map will have a mapping in the form of role-hint -> component. The role parameter is required if using a List or Map whereas a role-hint is not allowed.

Parameter Required Description
role No. Yes if the field is a List or a Map The role parameter is used to tell plexus what Component role you are interested in. For singleton fields their type is used as a default.
role-hint No. Not allowed if the field is a List or a Map Links to the role-hint defined by a component when looking up a component. Not allowed with List or Map fields, as they return all role-hints.