Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 2.52 KB

framework-spring-auto-reconfiguration.md

File metadata and controls

39 lines (32 loc) · 2.52 KB

Spring Auto Reconfiguration Framework

The Spring Auto Reconfiguration Framework causes an application to be automatically reconfigured to work with configured cloud services.

Detection CriterionExistence of a spring-core*.jar file in the application directory
Tagsspring-auto-reconfiguration-<version>
Tags are printed to standard output by the Buildpack detect script.

If the /WEB-INF/web.xml file exists, the framework will modify it in addition to making the auto reconfiguration JAR available on the classpath. These modifications include:

  1. Augmenting contextConfigLocation
    1. The function starts by enumerating the current contextConfigLocations. If none exist, a default configuration is created with /WEB-INF/application-context.xml or /WEB-INF/<servlet-name>-servlet.xml as the default.
    2. An additional location is then added to the collection of locations:
      • If the ApplicationContext is XML-based classpath:META- INF/cloud/cloudfoundry-auto-reconfiguration-context.xml
      • If the ApplicationContext is annotation-based org.cloudfoundry.reconfiguration.spring.web.CloudAppAnnotationConfigAutoReconfig
  2. Augmenting contextInitializerClasses
    1. The function starts by enumerating the current contextInitializerClasses. If none exist, a default configuration is created with no value as the default.
    2. The org.cloudfoundry.reconfiguration.spring.CloudApplicationContextInitializer class is then added to the collection of classes.

Configuration

For general information on configuring the Buildpack, refer to Configuration and Extension.

To configure the framework, you can modify the config/springautoreconfiguration.yml file. The framework uses the Repository utility support and it supports the version syntax.

Name Description
repository_root The URL of the Auto Reconfiguration repository index (details).
version The version of Auto Reconfiguration to use. You can find the candidate versions here.