spring:load

Full name:

org.kuali.maven.plugins:spring-maven-plugin:1.2.0:load

Description:

This mojo provides the ability to load a Spring context XML file. It uses a lightweight integration technique between Spring and Maven centered around java.util.Properties. Given the location of a Spring XML context, the mojo loads and injects it with a java.util.Properties object containing an augmented set of Maven properties. The java.util.Properties object is registered in the context as a bean under propertiesBeanName which defaults to maven.spring.properties. One typical use of the injected Maven properties in a Spring context is for replacing property placeholders.

For example:

 <beans>

  <context:property-placeholder properties-ref="maven.spring.properties" />

  <bean id="artifactId" class="java.lang.String">
   <constructor-arg value="${project.artifactId}" />
  </bean>

 </beans>

Attributes:

  • Requires a Maven project to be executed.

Required Parameters

Name Type Since Description
location String - Location of a Spring context XML file. This can be a file on the local file system, or any URL Spring's Resource loading framework understands eg classpath:my-context.xml
Default value is: classpath:${project.artifactId}-context.xml.
propertiesBeanName String - The name to use when registering the java.util.Properties object containing Maven properties as a bean in the Spring context.
Default value is: maven.spring.properties.
serviceClassname String - The implementation of org.kuali.common.util.service.SpringService to use
Default value is: org.kuali.common.util.service.DefaultSpringService.

Optional Parameters

Name Type Since Description
locations List - List of additional Spring context XML files to load (if any).
properties Properties - Additional properties to supply to the Spring context.

Parameter Details

location:

Location of a Spring context XML file. This can be a file on the local file system, or any URL Spring's Resource loading framework understands eg classpath:my-context.xml
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${spring.location}
  • Default: classpath:${project.artifactId}-context.xml

locations:

List of additional Spring context XML files to load (if any).
  • Type: java.util.List
  • Required: No

properties:

Additional properties to supply to the Spring context.
  • Type: java.util.Properties
  • Required: No

propertiesBeanName:

The name to use when registering the java.util.Properties object containing Maven properties as a bean in the Spring context.
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${spring.propertiesBeanName}
  • Default: maven.spring.properties

serviceClassname:

The implementation of org.kuali.common.util.service.SpringService to use
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${spring.serviceClassname}
  • Default: org.kuali.common.util.service.DefaultSpringService