The contents of this document are a work in progress

Configuration files

Plexus is using the following configuration files

  • plexus.xml
  • plexus.properties
  • components.xml files stored in jars

!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:

  • Define new component descriptors
  • Override component descriptors which are defined in components.xml files
  • Set up LoggerManager for the Application.
  • Choose which component should be loaded on startup

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)

Component configuration through /META-INF/plexus/components.xml

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.

Interpolation of configuration files

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.