For my Quarkus application I'm looking for a way to define a configuration map from within a custom ConfigProperties class. I tried the following:
import io.quarkus.arc.config.ConfigProperties;
import io.quarkus.runtime.annotations.ConfigItem;
@ConfigProperties(prefix = "my-properties")
public class MyPropertiesConfiguration {
@ConfigItem
public Map<String, FooConfiguration> foo;
// ...
}
import io.quarkus.runtime.annotations.ConfigGroup;
import io.quarkus.runtime.annotations.ConfigItem;
@ConfigGroup
public class FooConfiguration {
@ConfigItem
public String myProperty;
}
Given those two classes and the following application.properties file...
my-properties.foo.anystring.my-property=bar
on startup the application fails with error message:
javax.enterprise.inject.spi.DeploymentException: No config value of type [java.util.Map] exists for: my-properties.foo
As far as I understand https://quarkus.io/guides/writing-extensions#configuration-maps the sample should work. What am I doing wrong? Could it happen that this functionality is just limited to Quarkus extensions only?