Skip to content

Commit

Permalink
#5 microprofile-config 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rikcarve committed Mar 15, 2021
1 parent 00b5411 commit 1e23fca
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
target/

.idea/
/bin/
*.iml
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/ch.carve/mp-config-db/badge.svg?style=flat-square)](https://maven-badges.herokuapp.com/maven-central/ch.carve/mp-config-db/)

# mp-config-db
A eclipse microprofile config (1.3) extension which uses a database as source.
A eclipse microprofile config extension which uses a database as source.

## Versions
0.7 -> Microprofile config 1.4 \
0.8 -> Microprofile config 2.0

## Overview
The eclipse microprofile config framework is a simple yet powerful configuration framework for Java EE. But most implementations only provide the system/env properties or property files as configuration source. This small library provides an ConfigSource implementation which reads the values from the default datasource. For performance reasons, the config values are cached.
Expand All @@ -13,7 +17,7 @@ The eclipse microprofile config framework is a simple yet powerful configuration
<dependency>
<groupId>ch.carve</groupId>
<artifactId>mp-config-db</artifactId>
<version>0.7</version>
<version>0.8</version>
</dependency>
```

Expand Down
31 changes: 13 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ch.carve</groupId>
<artifactId>mp-config-db</artifactId>
<version>0.7</version>
<version>0.8-SNAPSHOT</version>
<packaging>jar</packaging>
<name>mp-config-db</name>
<description>ConfigurationSource for eclipse microprofile config based on a database</description>
Expand All @@ -31,31 +31,26 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<junit.jupiter.version>5.5.2</junit.jupiter.version>
<junit.jupiter.version>5.7.0</junit.jupiter.version>
</properties>

<dependencies>
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-api</artifactId>
<version>1.3</version>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>8.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.26</version>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
Expand All @@ -73,13 +68,13 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.23.4</version>
<version>3.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.config</groupId>
<artifactId>geronimo-config-impl</artifactId>
<version>1.2.2</version>
<groupId>io.smallrye.config</groupId>
<artifactId>smallrye-config</artifactId>
<version>2.0.2</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.spi.ConfigProviderResolver;
Expand Down Expand Up @@ -36,6 +37,11 @@ public Map<String, String> getProperties() {
return new HashMap<>();
}

@Override
public Set<String> getPropertyNames() {
return getProperties().keySet();
}

@Override
public String getValue(String propertyName) {
initRepository();
Expand Down

0 comments on commit 1e23fca

Please sign in to comment.