@@ -128,6 +128,7 @@ private static List<Class<?>> collectConfigRoots(ClassLoader classLoader) throws
128128 final List <ConfigClass > buildTimeRunTimeMappings ;
129129 final List <ConfigClass > runTimeMappings ;
130130 final List <ConfigClass > buildTimeVisibleMappings ;
131+ final Set <String > mappingsIgnorePaths ;
131132
132133 final Set <String > deprecatedProperties ;
133134 final Set <String > deprecatedRuntimeProperties ;
@@ -256,6 +257,28 @@ private BuildTimeConfigurationReader(ClassLoader classLoader, final List<Class<?
256257 buildTimeVisibleMappings .addAll (buildTimeMappings );
257258 buildTimeVisibleMappings .addAll (buildTimeRunTimeMappings );
258259
260+ mappingsIgnorePaths = new HashSet <>();
261+ for (ConfigClass buildTimeMapping : buildTimeMappings ) {
262+ // Already ignored all the quarkus namespace in QuarkusConfigBuilderCustomizer
263+ if (buildTimeMapping .getPrefix ().equals ("quarkus" ) || buildTimeMapping .getPrefix ().startsWith ("quarkus." )) {
264+ continue ;
265+ }
266+
267+ for (ConfigClass staticMapping : buildTimeRunTimeMappings ) {
268+ if (buildTimeMapping .getPrefix ().equals (staticMapping .getPrefix ())) {
269+ mappingsIgnorePaths .add (buildTimeMapping .getPrefix () + ".**" );
270+ break ;
271+ }
272+ }
273+
274+ for (ConfigClass runtimeMapping : runTimeMappings ) {
275+ if (buildTimeMapping .getPrefix ().equals (runtimeMapping .getPrefix ())) {
276+ mappingsIgnorePaths .add (buildTimeMapping .getPrefix () + ".**" );
277+ break ;
278+ }
279+ }
280+ }
281+
259282 deprecatedProperties = getDeprecatedProperties (allRoots );
260283 deprecatedRuntimeProperties = getDeprecatedProperties (runTimeRoots );
261284
@@ -422,6 +445,9 @@ public SmallRyeConfig initConfiguration(LaunchMode launchMode, Properties buildS
422445 for (ConfigClass mapping : getBuildTimeVisibleMappings ()) {
423446 builder .withMapping (mapping );
424447 }
448+ for (String mappingsIgnorePath : mappingsIgnorePaths ) {
449+ builder .withMappingIgnore (mappingsIgnorePath );
450+ }
425451
426452 builder .withInterceptors (buildConfigTracker );
427453 builder .withInterceptors (ConfigCompatibility .FrontEnd .instance (), ConfigCompatibility .BackEnd .instance ());
@@ -672,7 +698,7 @@ public void accept(final ConfigSource buildSystem) {
672698
673699 // ConfigMappings
674700 for (ConfigClass mapping : buildTimeVisibleMappings ) {
675- objectsByClass .put (mapping .getKlass (), config .getConfigMapping (mapping .getKlass (), mapping .getPrefix ()));
701+ objectsByClass .put (mapping .getType (), config .getConfigMapping (mapping .getType (), mapping .getPrefix ()));
676702 }
677703
678704 Set <PropertyName > buildTimeNames = mappingsToNames (buildTimeMappings ).keySet ();
@@ -725,6 +751,7 @@ public void accept(final ConfigSource buildSystem) {
725751 .setBuildTimeMappings (buildTimeMappings )
726752 .setBuildTimeRunTimeMappings (buildTimeRunTimeMappings )
727753 .setRunTimeMappings (runTimeMappings )
754+ .setMappingsIgnorePaths (mappingsIgnorePaths )
728755 .setUnknownBuildProperties (unknownBuildProperties )
729756 .setDeprecatedRuntimeProperties (deprecatedRuntimeProperties )
730757 .setBuildConfigTracker (buildConfigTracker )
@@ -1319,6 +1346,7 @@ public static final class ReadResult {
13191346 final List <ConfigClass > buildTimeRunTimeMappings ;
13201347 final List <ConfigClass > runTimeMappings ;
13211348 final List <ConfigClass > allMappings ;
1349+ final Set <String > mappingsIgnorePaths ;
13221350 final Map <Class <?>, ConfigClass > allMappingsByClass ;
13231351
13241352 final Set <String > unknownBuildProperties ;
@@ -1343,6 +1371,7 @@ public ReadResult(final Builder builder) {
13431371 this .buildTimeMappings = builder .getBuildTimeMappings ();
13441372 this .buildTimeRunTimeMappings = builder .getBuildTimeRunTimeMappings ();
13451373 this .runTimeMappings = builder .getRunTimeMappings ();
1374+ this .mappingsIgnorePaths = builder .getMappingsIgnorePaths ();
13461375 this .allMappings = new ArrayList <>(mappingsToMap (builder ).values ());
13471376 this .allMappingsByClass = mappingsToMap (builder );
13481377
@@ -1363,13 +1392,13 @@ private static Map<Class<?>, RootDefinition> rootsToMap(Builder builder) {
13631392 private static Map <Class <?>, ConfigClass > mappingsToMap (Builder builder ) {
13641393 Map <Class <?>, ConfigClass > map = new HashMap <>();
13651394 for (ConfigClass mapping : builder .getBuildTimeMappings ()) {
1366- map .put (mapping .getKlass (), mapping );
1395+ map .put (mapping .getType (), mapping );
13671396 }
13681397 for (ConfigClass mapping : builder .getBuildTimeRunTimeMappings ()) {
1369- map .put (mapping .getKlass (), mapping );
1398+ map .put (mapping .getType (), mapping );
13701399 }
13711400 for (ConfigClass mapping : builder .getRunTimeMappings ()) {
1372- map .put (mapping .getKlass (), mapping );
1401+ map .put (mapping .getType (), mapping );
13731402 }
13741403 return map ;
13751404 }
@@ -1426,6 +1455,10 @@ public List<ConfigClass> getRunTimeMappings() {
14261455 return runTimeMappings ;
14271456 }
14281457
1458+ public Set <String > getMappingsIgnorePaths () {
1459+ return mappingsIgnorePaths ;
1460+ }
1461+
14291462 public List <ConfigClass > getAllMappings () {
14301463 return allMappings ;
14311464 }
@@ -1467,6 +1500,7 @@ static class Builder {
14671500 private List <ConfigClass > buildTimeMappings ;
14681501 private List <ConfigClass > buildTimeRunTimeMappings ;
14691502 private List <ConfigClass > runTimeMappings ;
1503+ private Set <String > mappingsIgnorePaths ;
14701504 private Set <String > unknownBuildProperties ;
14711505 private Set <String > deprecatedRuntimeProperties ;
14721506 private ConfigTrackingInterceptor buildConfigTracker ;
@@ -1579,6 +1613,15 @@ Builder setRunTimeMappings(final List<ConfigClass> runTimeMappings) {
15791613 return this ;
15801614 }
15811615
1616+ Set <String > getMappingsIgnorePaths () {
1617+ return mappingsIgnorePaths ;
1618+ }
1619+
1620+ Builder setMappingsIgnorePaths (final Set <String > mappingsIgnorePaths ) {
1621+ this .mappingsIgnorePaths = mappingsIgnorePaths ;
1622+ return this ;
1623+ }
1624+
15821625 Set <String > getUnknownBuildProperties () {
15831626 return unknownBuildProperties ;
15841627 }
0 commit comments