Search code examples
javamavenmetricsquarkussmallrye

how create a custom Auto-Configuration in parent maven project with quarkus


Request description:
I want integration a few propertie (such as: quarkus.log.console.format、quarkus.smallrye-metrics.path) in parent maven project, new project just extend parent maven project can be auto-config that propertie and make sure all project get same propertie.

Simple relation:
Auto-Configuration parent project (has propertie: quarkus.smallrye-metrics.path=/myMetrics)
|———— A child Proejct (non-propertie)
|———— B child Proejct (non-propertie)

use http://${A project domain}/myMetrics and http://${B project domain}/myMetrics can get metrics.

Tried:

  1. add quarkus.smallrye-metrics.path=/myMetrics in parent project/application.properties
  2. read source code, but I can't find any way make it.

env infomation:

  1. java version: 1.8
  2. quarkus version: 1.5.2

Solution

  • This is already supported in Quarkus since 1.13: https://github.com/quarkusio/quarkus/pull/15282

    If you can't upgrade, you can use microprofile-config.properties instead which behaves the same way.