This library is an adapter to use plexus components in a springframework application context. It translates plexus components descriptors and interfaces to spring to get dependency injection and interface based lifecycle management, with some limitations.
Pexus-spring provides to plexus components :
Plexus-spring defines some custom Spring components :
This adapter library has been created as part of the migration effort from plexus to spring in apache Archiva. It allows a smooth migration from plexus to spring as the initial components can be used as is in spring until they are migrated to be more spring compliant or replaced.
It can also be used to support some plexus components packaged as jars that provide helpfull features to a spring-based application.
Some components use interpolation in the configuration element with some predefined values (plexus.home).
To handle this you have to record a propertyConfigurer Spring bean :
<bean id="propertyConfigurer" class="org.codehaus.plexus.spring.PlexusServletContextPropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:plexus.properties</value> </list> </property> <!-- ignore if plexus.properties not found --> <property name="ignoreResourceNotFound"> <value>true</value> </property> <!-- ignore if a interpolated key not exists --> <property name="ignoreUnresolvablePlaceholders"> <value>true</value> </property> </bean>
The PlexusServletContextPropertyPlaceholderConfigurer will set a plexus.home value (if not already found in the properties defined in location to File( servletContext.getRealPath( "/WEB-INF" ) ).getAbsolutePath()