Spring Config

Version: 1.0.4Minimum Jenkins requirement: 2.204.6ID: spring-config
Installs: 20
Last released:
Maintainers
Gong Yi

This plugin is used to read Spring Boot style application properties files.

Usage

This plugin supports custom location and profiles. The return is a nested Map object.

Suppose there's a yaml style application.yaml config file.

foo:
  bar: value1

Read the config file

def config=springConfig()
print config.foo.bar // Nested style
print config.asProperties()['foo.bar'] // All keys are flattened
print config.asPropertiesFileContent()  // It returns standard Java properties file format. All no ascii string are escapted.

Each build has a 'Spring Config' page which shows the configuration read by this plugin.

Parameters

  • profiles: A list of profiles. See detail at Spring Document.

  • location: The custom location. The plugin reads the configuration files either at current directory (workspace root or dir step) or a config sub directory. If not in these two, a relative path must be specified. This path must end with '/' if it is a directory.

  • hideInBuildPage: Don't show the configurtions in the build 'Spring Config' page.

Example:

def config=springConfig(profiles: ['p1','p2'], location : 'custom-config/,custom-config2/')
ArchivesGet past versions
Links
Labels
This plugin has no labels