Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 2.52 KB

framework-spring_auto_reconfiguration.md

File metadata and controls

35 lines (28 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 Criterion Existence of a spring-core*.jar file in the application directory
Tags spring-auto-reconfiguration=<version>
Tags are printed to standard output by the buildpack detect script

If a /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. The function starts be 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. An additional location is then added to the collection of locations; classpath:META- INF/cloud/cloudfoundry-auto-reconfiguration-context.xml if the ApplicationContext is XML-based, org.cloudfoundry.reconfiguration.spring.web.CloudAppAnnotationConfigAutoReconfig if the ApplicationContext is annotation-based.
  2. Augmenting contextInitializerClasses. The function starts by enumerating the current contextInitializerClasses. If none exist, a default configuration is created with no value as the default. 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.

The framework can be configured by modifying the config/spring_auto_reconfiguration.yml file. The framework uses the Repository utility support and so it supports the version syntax defined there.

Name Description
repository_root The URL of the Auto Reconfiguration repository index (details).
version The version of Auto Reconfiguration to use. Candidate versions can be found in this listing.