Popularity
1.8
Declining
Activity
7.1
-
26
3
0

Programming language: Java
License: Apache License 2.0
Tags: Configuration     Projects    

Externalized Properties alternatives and similar libraries

Based on the "Configuration" category.
Alternatively, view externalized-properties alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Externalized Properties or a related project?

Add another 'Configuration' Library

README

Externalized Properties

Gradle Build Maven Central Coverage Status Known Vulnerabilities License Total alerts Language grade: Java Quality Gate Status Maintainability Rating Reliability Rating Security Rating Vulnerabilities

A lightweight and extensible library to resolve application properties from various external sources.

Twelve Factor Methodology

Externalized Properties was inspired by the The Twelve Factor Methodology's section III. Config.

The goal of this library is to make it easy for applications to implement configuration best practices by providing easy-to-use APIs as well as providing the flexibility to choose where to store their configurations/properties.

๐Ÿ› ๏ธ Installation

Gradle

implementation "io.github.joeljeremy7.externalizedproperties:core:${version}"

Maven

<dependency>
    <groupId>io.github.joeljeremy7.externalizedproperties</groupId>
    <artifactId>core</artifactId>
    <version>${version}</version>
</dependency>

๐Ÿงฉ Java 9 Module Names

Externalized Properties jars are published with Automatic-Module-Name manifest attribute:

  • Core - io.github.joeljeremy7.externalizedproperties.core
  • Database Resolver - io.github.joeljeremy7.externalizedproperties.resolvers.database

Module authors can use above module names in their module-info.java:

module foo.bar {
    requires io.github.joeljeremy7.externalizedproperties.core;
    requires io.github.joeljeremy7.externalizedproperties.resolvers.database;
}

๐ŸŒŸ Features

๐Ÿ”— [Property Resolution via Java Dynamic Proxies](docs/property-resolution.md) ([Why Dynamic Proxies?](docs/why-dynamic-proxies.md))

โœจ Default/Fallback Values
โœจ Non-static Property Names
โœจ Variable Expansion
โœจ Caching
โœจ Eager Loading
โœจ Automatic Cache Reload

๐Ÿ”— [Property Post-Processing](docs/property-post-processing.md)

โœจ Symmetric/Asymmetric Decryption

๐Ÿ”— [Property Conversion](docs/property-conversion.md)

โœจ Generic Type Conversion

๐ŸŽ๏ธ Quick Start

Given an interface:

public interface ApplicationProperties {
    @ExternalizedProperty("java.home")
    String javaHome();

    @ExternalizedProperty("encrypted.property")
    @Decrypt("MyDecryptor")
    String encryptedProperty();

    @ExternalizedProperty("java.version")
    int javaVersion();
}

We can initialize and start resolving external configurations/properties by:

public static void main(String[] args) {
    ExternalizedProperties externalizedProperties = buildExternalizedProperties();

    // Proxied interface.
    ApplicationProperties props = externalizedProperties.proxy(ApplicationProperties.class);

    // Use properties.
    String javaHome = props.javaHome();
    String encryptedProperty = props.encryptedProperty();
    int javaVersion = props.javaVersion();
}

private static ExternalizedProperties buildExternalizedProperties() {
    return ExternalizedProperties.builder()
        .withDefaults() 
        .resolvers(...)
        .processors(...)
        .converters(...) 
        .build();
}


*Note that all licence references and agreements mentioned in the Externalized Properties README section above are relevant to that project's source code only.