!plexus-configuration-files.gif!
All components which can be used by plexus must have a Component Descriptor.
Component Descriptors can be declared in two places: plexus.xml and in components.xml files which are kept in jars (META-INF/plexus/components.xml).
plexus.xml files allows you to configure the following aspects of application:
Plexus component descriptor contains many pieces which must be provided only once. For example componet requiremnets, profile etc are pratically constant.
That's why it is profitable to put such information into jar files and reuse it.
plexus.properties file is used for seeding plexus context which is then used for interpolation of variables in xml configuration files (see the explanation below)
When starting up Plexus will start discovering components. The default configuration uses the DefaultComponentDiscoverer to discover components.
The DefaultComponentDiscoverer will look for /META-INF/plexus/components.xml files using ClassLoader.getResources(). For getting your components picked up by plexus all you need is to have the components.xml file in your jar.
Plexus will interpolate all the variables that are strings in the plexus context in the configuration file. For instance, the "plexus.home" is a context variable that tells you the location of the Plexus install. To use that in your configuration, you would do something like this:
<configuration>
<directory>${plexus.home}/directory</directory>
</configuration>
This would automatically be expanded to the full directory name when you configure your component.