helidon icon indicating copy to clipboard operation
helidon copied to clipboard

4.x: MP `ConfigSource.getOrdinal()` always returns 100 if default ordinals are used

Open barchetta opened this issue 9 months ago • 0 comments

Environment Details

  • Helidon Version: 4.0.8
  • Helidon MP

Problem Description

ConfigSource.getOrdinal() always returns 100 when default ordinals are used. The precedence of the config sources does appear to be correct (i.e. the sources are ordered correctly), but the getOrdinal() method always returns 100.

Steps to reproduce

Generate the Helidon Quickstart MP application using the CLI. Add this line to the GreetResource constructor:

            ConfigProvider.getConfig().getConfigSources().forEach(it -> System.out.println(it.getOrdinal() + ":" + it.getName()));

Run the application and hit an endpoint. You will see:

100:System Properties
100:Environment Variables
100:jar:file:/Users/jdipol/tmp/4.0.8/bug/quickstart-mp/target/quickstart-mp.jar!/META-INF/microprofile-config.properties

This is incorrect. The ordinals should be 400, 300, 100 (as defined in the spec).

barchetta avatar May 08 '24 23:05 barchetta