Code Monkey home page Code Monkey logo

spring-config-plugin's Introduction

Spring Config Plugin

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

Define the profile names

Profile names can be defined at job configuration. Job Configuration Or job folder configuration Folder Configuration In structures where two or more folders are nested, all profile name are merged together.

Retrieve the profile names

Use SpringProfiles() to retrieve the profile names defined

def profiles=springProfiles()

Get value from spring application style configuration file

This plugin supports custom location and profiles. The returned value 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 configurations in the build 'Spring Config' page.

Example:

def profiles=springProfiles()
def config=springConfig(profiles: profiles, location : 'custom-config/,custom-config2/')

spring-config-plugin's People

Contributors

topikachu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.