@@ -7,6 +7,20 @@ A collection of Spring-Boot supporting tools.
77[ ![ sponsored] ( https://img.shields.io/badge/sponsoredBy-Holisticon-RED.svg )] ( https://holisticon.de/ )
88[ ![ Maven Central] ( https://maven-badges.herokuapp.com/maven-central/io.toolisticon.spring/spring-conditions/badge.svg )] ( https://maven-badges.herokuapp.com/maven-central/io.toolisticon.spring/spring-conditions )
99
10+ ## Import
11+
12+ Import the BOM into your Maven project.
13+
14+ ``` xml
15+ <dependency >
16+ <groupId >io.toolisticon.spring</groupId >
17+ <artifactId >spring-boot-bom</artifactId >
18+ <version >1.0.1</version >
19+ <scope >import</scope >
20+ <type >pom</type >
21+ </dependency >
22+ ```
23+
1024## Spring-Boot Conditions
1125
1226Provides useful Spring-Boot conditions.
@@ -21,8 +35,59 @@ Provides useful Spring-Boot conditions.
2135
2236<dependency >
2337 <groupId >io.toolisticon.spring</groupId >
24- <artifactId >spring-conditions</artifactId >
25- <version >1.0.0</version >
38+ <artifactId >spring-boot-conditions</artifactId >
2639</dependency >
40+ ```
2741
42+ ## YAML property source factory
43+
44+ Allows to define default properties as part of the starter using supplied YAML file.
45+
46+ ### Usage
47+
48+ ``` xml
49+ <dependency >
50+ <groupId >io.toolisticon.spring</groupId >
51+ <artifactId >spring-boot-properties</artifactId >
52+ </dependency >
2853```
54+
55+ Define properties
56+
57+ ``` kotlin
58+ @ConfigurationProperties(" myprops" )
59+ data class MyProperties (
60+ val foo : String ,
61+ val zee : Int ,
62+ val baz : Boolean
63+ )
64+
65+ ```
66+
67+ Define configuration:
68+
69+ ``` kotlin
70+
71+ @EnableConfigurationProperties(MyProperties ::class )
72+ @PropertySource(
73+ name = " myDefaultProperties" ,
74+ value = [" classpath:/application-my-default.yaml" ],
75+ factory = YamlPropertySourceFactory ::class
76+ )
77+ class MyConfiguration
78+
79+ ```
80+
81+ Put a ` application-my-default.yaml ` into ` src/main/resources ` :
82+
83+ ``` yaml
84+ myprops :
85+ foo : " bar"
86+ zee : 42
87+ baz : true
88+ ` ` `
89+
90+
91+ # License
92+
93+ This library is published under the Apache 2.0 license.
0 commit comments