The contents of this document are a work in progress
The 'Avalon' personality
A good overview of how avalon components work can be found on the Avalon website here. This should beneficial if you are programming components for the Plexus personality as well, since the Plexus personality is loosely based on the Avalon API.
- Enabling the Avalon Personality
You must do three things to enable the Avalon personality within Plexus:
- Add the avalon dependencies
<dependency> <id>avalon-framework</id> <version>4.1.4</version> <url>http://jakarta.apache.org/avalon</url> </dependency> <dependency> <groupId>plexus</groupId> <artifactId>plexus-avalon-personality</artifactId> <version>0.12</version> </dependency>
- Add the lifecycle handler to the plexus configuration
<component-repository implementation="org.codehaus.plexus.personality.avalon.AvalonComponentRepository"> <composition-resolver implementation="org.codehaus.plexus.component.composition.DefaultCompositionResolver"/> </component-repository> <!-- | | Lifecycle handler Manager. | --> <lifecycle-handler-manager implementation='org.codehaus.plexus.lifecycle.DefaultLifecycleHandlerManager'> <default-lifecycle-handler-id>avalon</default-lifecycle-handler-id> <lifecycle-handlers> <lifecycle-handler implementation='org.codehaus.plexus.personality.avalon.AvalonLifecycleHandler'> <id>avalon</id> <name>Avalon Lifecycle Handler</name> <begin-segment> <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.LogEnablePhase'/> <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.ContextualizePhase'/> <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.ServicePhase'/> <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.ComposePhase'/> <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.ConfigurePhase'/> <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.InitializePhase'/> <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.StartPhase'/> </begin-segment> <suspend-segment> <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.SuspendPhase'/> </suspend-segment> <resume-segment> <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.ResumePhase'/> <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.RecontextualizePhase'/> <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.ReconfigurePhase'/> </resume-segment> <end-segment> <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.StopPhase'/> <phase implementation='org.codehaus.plexus.personality.avalon.lifecycle.phase.DisposePhase'/> </end-segment> </lifecycle-handler> </lifecycle-handlers> </lifecycle-handler-manager>
If you wish to have the Avalon personality be your default personality keep the line
<default-lifecycle-handler-id>avalon</default-lifecycle-handler-id>
in your code. Otherwise remove it and add a tag to each avalon component configuration like so:
<component> <role>org.codehaus.plexus.jetty.ServletContainer</role> <implementation>org.codehaus.plexus.jetty.JettyServletContainer</implementation> <lifecycle-handler>avalon</lifecycle-handler> </component>
- Add the avalon dependencies