-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes for using @ConfigMapping in quarkus extensions
- Loading branch information
1 parent
bab1ceb
commit 296de18
Showing
5 changed files
with
29 additions
and
31 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
solution/quarkus-appinfo-application/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# Application Name | ||
quarkus.application.name=Demo Application AppInfo | ||
quarkus.application.name=My Demo Application AppInfo | ||
|
||
# build time (only available at build time) | ||
quarkus.appinfo.always-include=true | ||
quarkus.appinfo.record-build-time=true | ||
quarkus.appinfo.built-for=quarkus-training | ||
quarkus.appinfo.built-for=quarkus basics training | ||
|
||
# runtime (changeable at runtime) | ||
quarkus.appinfo.run-by=Puzzle ITC GmbH | ||
quarkus.appinfo.run-by=Tim&Koko AG |
23 changes: 12 additions & 11 deletions
23
...n/java/ch/puzzle/quarkustechlab/extensions/appinfo/deployment/AppinfoBuildTimeConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
package ch.puzzle.quarkustechlab.extensions.appinfo.deployment; | ||
|
||
import ch.puzzle.quarkustechlab.extensions.appinfo.runtime.AppinfoNames; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigPhase; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
import io.smallrye.config.ConfigMapping; | ||
import io.smallrye.config.WithDefault; | ||
|
||
@ConfigRoot(name = AppinfoNames.EXTENSION_NAME, phase = ConfigPhase.BUILD_TIME) | ||
public class AppinfoBuildTimeConfig { | ||
@ConfigMapping(prefix = AppinfoNames.CONFIG_PREFIX) | ||
@ConfigRoot(phase = ConfigPhase.BUILD_TIME) | ||
public interface AppinfoBuildTimeConfig { | ||
|
||
/** | ||
* Simple builtFor information string | ||
*/ | ||
@ConfigItem | ||
String builtFor; | ||
String builtFor(); | ||
|
||
/** | ||
* Include build time collection feature in build | ||
*/ | ||
@ConfigItem(defaultValue = "true") | ||
boolean recordBuildTime; | ||
@WithDefault("true") | ||
boolean recordBuildTime(); | ||
|
||
/** | ||
* Always include this. By default this will only be included in dev and test. | ||
* Setting this to true will also include this in Prod | ||
*/ | ||
@ConfigItem(defaultValue = "false") | ||
boolean alwaysInclude; | ||
@WithDefault("false") | ||
boolean alwaysInclude(); | ||
|
||
/** | ||
* Specify basePath for extension endpoint | ||
*/ | ||
@ConfigItem(defaultValue = AppinfoNames.EXTENSION_NAME) | ||
String basePath; | ||
@WithDefault(AppinfoNames.EXTENSION_NAME) | ||
String basePath(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
...c/main/java/ch/puzzle/quarkustechlab/extensions/appinfo/runtime/AppinfoRunTimeConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
package ch.puzzle.quarkustechlab.extensions.appinfo.runtime; | ||
|
||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigPhase; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
import io.smallrye.config.ConfigMapping; | ||
|
||
@ConfigRoot(name = AppinfoNames.EXTENSION_NAME, phase = ConfigPhase.RUN_TIME) | ||
public class AppinfoRunTimeConfig { | ||
@ConfigMapping(prefix = AppinfoNames.CONFIG_PREFIX) | ||
@ConfigRoot(phase = ConfigPhase.RUN_TIME) | ||
public interface AppinfoRunTimeConfig { | ||
|
||
/** | ||
* Simple runBy information string | ||
*/ | ||
@ConfigItem | ||
String runBy; | ||
String runBy(); | ||
} |