Dropwizard :: Configuration :: Jtwig Templates

Treats the configuration file as a Jtwig template

Лицензия

Лицензия

Категории

Категории

DropWizard Контейнер Микросервисы Configuration Библиотеки уровня приложения config
Группа

Группа

zone.dragon.dropwizard
Идентификатор

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

dropwizard-configuration-jtwig
Последняя версия

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

1.1.4-b6fb6b
Дата

Дата

Тип

Тип

jar
Описание

Описание

Dropwizard :: Configuration :: Jtwig Templates
Treats the configuration file as a Jtwig template
Ссылка на сайт

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

https://github.com/dragonzone/dropwizard-configuration-jtwig
Организация-разработчик

Организация-разработчик

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

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

https://github.com/dragonzone/dropwizard-configuration-jtwig/tree/master

Скачать dropwizard-configuration-jtwig

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

<!-- https://jarcasting.com/artifacts/zone.dragon.dropwizard/dropwizard-configuration-jtwig/ -->
<dependency>
    <groupId>zone.dragon.dropwizard</groupId>
    <artifactId>dropwizard-configuration-jtwig</artifactId>
    <version>1.1.4-b6fb6b</version>
</dependency>
// https://jarcasting.com/artifacts/zone.dragon.dropwizard/dropwizard-configuration-jtwig/
implementation 'zone.dragon.dropwizard:dropwizard-configuration-jtwig:1.1.4-b6fb6b'
// https://jarcasting.com/artifacts/zone.dragon.dropwizard/dropwizard-configuration-jtwig/
implementation ("zone.dragon.dropwizard:dropwizard-configuration-jtwig:1.1.4-b6fb6b")
'zone.dragon.dropwizard:dropwizard-configuration-jtwig:jar:1.1.4-b6fb6b'
<dependency org="zone.dragon.dropwizard" name="dropwizard-configuration-jtwig" rev="1.1.4-b6fb6b">
  <artifact name="dropwizard-configuration-jtwig" type="jar" />
</dependency>
@Grapes(
@Grab(group='zone.dragon.dropwizard', module='dropwizard-configuration-jtwig', version='1.1.4-b6fb6b')
)
libraryDependencies += "zone.dragon.dropwizard" % "dropwizard-configuration-jtwig" % "1.1.4-b6fb6b"
[zone.dragon.dropwizard/dropwizard-configuration-jtwig "1.1.4-b6fb6b"]

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
com.fasterxml.jackson.core : jackson-core jar
io.dropwizard : dropwizard-configuration jar
io.dropwizard : dropwizard-core jar
org.jtwig : jtwig-core jar 5.86.1.RELEASE
org.slf4j : slf4j-api jar 1.7.25

provided (1)

Идентификатор библиотеки Тип Версия
org.projectlombok : lombok jar 1.16.20

test (3)

Идентификатор библиотеки Тип Версия
org.assertj : assertj-core jar 3.9.1
org.junit.jupiter : junit-jupiter-api jar 5.2.0
io.dropwizard : dropwizard-testing jar

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

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

Dropwizard Jtwig Templates Configuration Build Status Maven Central

This bundle enables jtwig template processing of an applications config.yaml file, making it easy to interpolate environmental variables, system properties, and other boot-time properties (such as passwords and secrets) into your application config, as well as making structural changes and alterations to the configuration based on settings such as the OS type or other environmental cues.

To use this bundle, add it to your application in the initialize method:

@Override
public void initialize(Bootstrap<YourConfig> bootstrap) {
    bootstrap.addBundle(new JtwigConfigurationBundle());
}

The initial data model contains all environmental variables under the env key, such as {{ env.PATH }} or {{ env.HOME }}, and all system properties under the system key, such as {{ system["user.dir"] }}

Escaping

By default, any strings will be escaped, so interpolations of strings should be double-quoted:

homeDir: "{{ env.HOME }}"

to insert an unescaped string, use the none format with the autoescape operator:

{% autoescape 'none' %}
homeDir: {{ env.HOME }}
{% endautoescape %}

Customizing Template Rendering

To customize the variables available inside the template, use one of the constructor overloads to pass in the desired model. This makes it easy to inject secrets or other startup properties into your configuration. For more advanced customizations, the EnvironmentConfiguration itself can be provided for use.

Note: When providing a custom data model or environment configuration, no defaults will be added; If you still want support for the environment variables, system properties, or YAML-compatible string escaping, you must make sure to include them in the inputs provided to the plugin.

zone.dragon.dropwizard

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

Версия
1.1.4-b6fb6b
1.0.1-db2632