spring:load

Full name:

org.kuali.maven.plugins:spring-maven-plugin:1.1.0-SNAPSHOT:load

Description:

Load a Spring context XML file optionally filtering it using Maven properties before doing so. If exportProperties is true, Maven properties are exported to the file system prior to loading and filtering the Spring context. The path to the exported properties file is automatically added to the properties under the key maven.spring.properties. This combination allows you to inject Maven properties into a Spring context by setting filterContext=true and adding one line of configuration:

<context:property-placeholder location="${maven.spring.properties}" />

OR

<util:properties id="mavenProperties" location="${maven.spring.properties}" />

Attributes:

  • Requires a Maven project to be executed.

Required Parameters

Name Type Since Description
contextLocation String - Location of a Spring context XML file. This can be any URL Spring's Resource loading framework understands eg classpath:mycontext.xml
Default value is: classpath:${project.artifactId}-context.xml.

Optional Parameters

Name Type Since Description
encoding String - Character encoding for the context XML file
Default value is: ${project.build.sourceEncoding}.
exportExcludes List - List of properties to exclude. No properties are excluded by default.
exportIncludes List - List of properties to include. All properties are included by default.
exportProperties boolean - If true, Maven properties are exported to the file system prior to filtering and loading the Spring context.
Default value is: false.
exportPropertiesFile File - The file to export properties to when exportProperties is true
Default value is: ${project.build.directory}/spring/maven.properties.
exportPropertiesFileProperty String - If exportProperties is true, the path to the exported properties file will be included as a property under this key
Default value is: maven.spring.properties.
filterContext boolean - If true contextLocation is filtered before being loaded
Default value is: false.
filterExcludes List - List of properties to exclude. No properties are excluded by default.
filterIncludes List - List of properties to include. All properties are included by default.
properties Properties - Additional properties supplied directly to the mojo
workingDir File - Working directory for the plugin.
Default value is: ${project.build.directory}/spring.

Parameter Details

contextLocation:

Location of a Spring context XML file. This can be any URL Spring's Resource loading framework understands eg classpath:mycontext.xml
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${spring.contextLocation}
  • Default: classpath:${project.artifactId}-context.xml

encoding:

Character encoding for the context XML file
  • Type: java.lang.String
  • Required: No
  • Expression: ${spring.encoding}
  • Default: ${project.build.sourceEncoding}

exportExcludes:

List of properties to exclude. No properties are excluded by default.
  • Type: java.util.List
  • Required: No

exportIncludes:

List of properties to include. All properties are included by default.
  • Type: java.util.List
  • Required: No

exportProperties:

If true, Maven properties are exported to the file system prior to filtering and loading the Spring context.
  • Type: boolean
  • Required: No
  • Expression: ${spring.exportProperties}
  • Default: false

exportPropertiesFile:

The file to export properties to when exportProperties is true
  • Type: java.io.File
  • Required: No
  • Expression: ${spring.exportPropertiesFile}
  • Default: ${project.build.directory}/spring/maven.properties

exportPropertiesFileProperty:

If exportProperties is true, the path to the exported properties file will be included as a property under this key
  • Type: java.lang.String
  • Required: No
  • Expression: ${spring.exportPropertiesFileProperty}
  • Default: maven.spring.properties

filterContext:

If true contextLocation is filtered before being loaded
  • Type: boolean
  • Required: No
  • Expression: ${spring.filterContext}
  • Default: false

filterExcludes:

List of properties to exclude. No properties are excluded by default.
  • Type: java.util.List
  • Required: No

filterIncludes:

List of properties to include. All properties are included by default.
  • Type: java.util.List
  • Required: No

properties:

Additional properties supplied directly to the mojo
  • Type: java.util.Properties
  • Required: No

workingDir:

Working directory for the plugin.
  • Type: java.io.File
  • Required: No
  • Expression: ${spring.workingDir}
  • Default: ${project.build.directory}/spring