Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • A Spring property file – a simple text file with a property name, equals sign, and the property value, one per line. This file is named: application.properties
  • a YAML format file, named application.yml

Choosing which format to use is largely a personal choice as functionally they are identical. One caveat is in the case that there is both a properties and yml file, the properties file will be read first.

The MCM comes with a basic examples example of both types of properties files.  Complete list of properties can be found here and additional configuration for the YAML format is here.The example application.properties file includes the , with the example application.properties file having the core settings for authentication, database connection information, users file, the directory/location settings for where the MCM UI should write out the metadata files and metadata-providers.xml file it manages, etc. The example applicationexample application.yml file yml file contains all the settings that impact the information, options, list elements, etc. that are actually shown in the UI.

There is no technical reason that you need to follow the examples and keep that the distinction; you could manage everything through a single application.properties or YAML-format file application.yml if you wanted. On the other hand, it can be a convenient distinction to keep the core "internal/baked-in settings" distinct from the "front-end/UI" settings. By default, property sources named `application.properties` and `application.yml` will be recognized by Spring Boot and merged at runtime to form a finalized `Environment` object holding all the properties gathered from all the property sources locations. Details on the properties that can/should be configured are detailed later in this document

The application properties are Spring configuration files, and follow its built-in methods for where it looks for these files:

  • The classpath root
  • The classpath /config package
  • The current directory (note, in the Internet2 Docker image the "current directory" will be the working directory which is /opt/shibui)
  • The /config subdirectory of the current directory
  • Immediate child directories of the config/ subdirectory
  • File name option passed to the executable jar --spring.config.location=file://{absolute-path-to-file}
  • Directory name passed to the executable jar --spring.config.location=file://{absolute-path-to-directory}
  • Java property -Dspring.config.location
  • Environment variable SPRING_CONFIG_LOCATION
  • Property spring.config.additional-location


Spring properties also utilize profile designations which target the reading of an environment-specific configuration file.

  • Java property -Dspring.profiles.active=prod
  • Environment variable SPRING_PROFILES_ACTIVE=prod
  • Property spring.profiles.active=prod

Application startup will additionally load the file application-prod.properties using the same search order as for application.properties.