"Springify Multiconfig"

"Configuration per module for Spring Boot projects"

Лицензия

Лицензия

Категории

Категории

config Библиотеки уровня приложения Configuration
Группа

Группа

com.it-surmann
Идентификатор

Идентификатор

springify-multiconfig
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

"Springify Multiconfig"
"Configuration per module for Spring Boot projects"
Ссылка на сайт

Ссылка на сайт

https://github.com/tleipzig/springify-multiconfig
Система контроля версий

Система контроля версий

https://github.com/tleipzig/springify-multiconfig

Скачать springify-multiconfig

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.it-surmann/springify-multiconfig/ -->
<dependency>
    <groupId>com.it-surmann</groupId>
    <artifactId>springify-multiconfig</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.it-surmann/springify-multiconfig/
implementation 'com.it-surmann:springify-multiconfig:1.0.0'
// https://jarcasting.com/artifacts/com.it-surmann/springify-multiconfig/
implementation ("com.it-surmann:springify-multiconfig:1.0.0")
'com.it-surmann:springify-multiconfig:jar:1.0.0'
<dependency org="com.it-surmann" name="springify-multiconfig" rev="1.0.0">
  <artifact name="springify-multiconfig" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.it-surmann', module='springify-multiconfig', version='1.0.0')
)
libraryDependencies += "com.it-surmann" % "springify-multiconfig" % "1.0.0"
[com.it-surmann/springify-multiconfig "1.0.0"]

Зависимости

runtime (1)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter jar

test (1)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter-test jar

Модули Проекта

Данный проект не имеет модулей.

Springify Multiconfig Build Status Maven Central Licence

Springify Multiconfig loads application YAML files from all jars in the classpath into the application context of a Spring Boot application, helping to split the configuration of multi-module projects.

It’s part of Springify, a set of open source libraries supporting the development of Spring Boot projects.

Usage

Just add the dependency from the Maven Central Repository:

<dependency>
  <groupId>com.it-surmann</groupId>
  <artifactId>springify-multiconfig</artifactId>
  <version>1.0.0</version>
</dependency>

Springify Multiconfig is now scanning for files with the name application-mc-*.yml, which are then loaded into the application context.

Example

A typical multi-module project may look like this.

 +-------------------+
 |    module-web     | containing application.yml, application-prod.yml
 +-------------------+
          |
          V
 +-------------------+
 |    module-blog    | containing application-mc-blog.yml
 +-------------------+
          |
          V
 +-------------------+
 | module-newsletter |  containing application-mc-newsletter.yml
 +-------------------+
          |
          V
 +-------------------+
 |   module-basics   | containing application-mc-basics.yml
 +-------------------+

The separation helps to keep code and configuration together, so each module can provide its own configuration if needed. The default behaviour for initializing the application context remains untouched, so in the example the application YAML files of module-web are loaded by Spring Boot itself (depending on the active profile).

Tip
Specify the dependency to springify-multiconfig on the lowest module (module-basics).

When the application is started, all modules are part of it and all application YAML files are loaded. They are ordered corresponding to the dependency graph, so in the example the application-mc-blog.yml would override properties of application-mc-newsletter.yml and application-mc-basics.yml with the same name (if present).

If a module contains a test class initializing the context, only the application YAML files of the current module plus dependencies are loaded. For example a class NewsletterServiceIT in module-newsletter annotated with @SpringBootTest would load application-mc-basics.yml as well as application-mc-newsletter.yml, but nothing else.

Версии библиотеки

Версия
1.0.0