Questions tagged [configurationproperties]
89 questions
1
vote
1 answer
override spring-boot property in dependency jar file
I have a spring boot project that depends on one of the 3rd party SDK libraries which contains a YAML file with some google cloud URLs.
I want to override those values within my YAML, this works for most of my project but for some reason no luck…

No_One
- 215
- 2
- 3
- 11
1
vote
1 answer
Issues with test execution with @ConfigurationProperties usage in java sbring-boot application
Context is getting passed as null, hence getting NullPointerException in context.getBean("abcRestTemplate", RestTemplate.class). What can be the issue for context to be null.
AuthnConfig.java
@Getter
@ConfigurationProperties(prefix =…

hmims
- 539
- 8
- 28
1
vote
0 answers
@ConfigurationProperties with @Validated don’t bind configuration values in integration tests
I have a validated configuration properties class.
@Data
@Configuration
@ConfigurationProperties(prefix = "notifications")
@Validated
public class NotificationConfig {
@NotNull
@Valid
private NotificationMessageConfig message = new…

Maksym Kmets
- 53
- 7
1
vote
1 answer
SpringBoot @ConfigurationProperties issue with key that contains /
I don't know if it's normal behaviour or a bug.
I've created a ConfiguationProperties :
@Configuration
@ConfigurationProperties("sample")
public class MyConfig {
private Map labels;
public Map getLabels()…

Gildas Cuisinier
- 233
- 2
- 8
1
vote
0 answers
ConfigurationProperties class doesn't load information from native image
I'm working with Micronaut GraalVM application, I've created a class to load information from application.yml using @ConfigurationProperties, it works when I run my jar application, then I built a native image with it, but my configuration…

Antonio
- 115
- 6
1
vote
1 answer
LNK2019 From Unresolved External Symbol _main in MSVCRTD.lib For New DLL Project
I've begun a new C++ solution in Visual Studio 2019 which contains two projects (hereafter: project1 and project2).
Project1 is set as a DLL project and has no main() or _main() function. Project2 is set as the startup project and contains the…

Wickerbough
- 365
- 1
- 4
- 15
1
vote
2 answers
Load Yml at runtime with Spring Boot
I have multiple yml files in different folders. All the files in the folder share the same property structure which I mapped with a java bean.
At runtime, with a factory, I want to get the right bean populated with the values of the specific file…

Gfalco
- 77
- 3
- 13
1
vote
1 answer
Default values for missing maven properties when expanded in spring application.properties
If a property @property.absent@ defined in application.properties cannot be expanded (it is not defined in pom.xml), the bound value is the literal @property.absent@. Is there an easy way to override this with custom defaults (e.g. null), esp. in…

zmeeagain
- 439
- 4
- 4
1
vote
0 answers
@ConfigurationProperties with @Bean doesn't load defaults from classpath
I'm facing following problem with @ConfigurationProperties placed on @Bean.The configuration is placed into application.yml within the library jar by default:
@Configuration
@ConfigurationPropertiesScan
public class MyConfiguration {
…

Gena Batalski
- 103
- 1
- 2
- 6
1
vote
1 answer
Override setter in @ConfigurationProperties with list type
I am using Spring Boot 1.5.15 and I am having some trouble during the reading of a bean annotated with the annotation @ConfigurationProperties.
In details, I am trying to use the following bean.
@ConfigurationProperties(prefix =…

riccardo.cardin
- 7,971
- 5
- 57
- 106
1
vote
2 answers
Not Binding ==> Consul KV + Kotlin Spring Boot @ConfigurationProperties @ConstructorBinding
I need to move our application.yml configurations to Hashicorp's Consul. I've created a simple Spring Boot application to work through the required changes. It loads the configuration data from application.yml to a strongly typed class.
However,…

A Bit of Help
- 1,368
- 19
- 36
1
vote
1 answer
Which Spring Boot @ConfigurationProperties annotated bean holds the spring.profiles.active property?
I would like to NOT retrieve this property that way:
@Value("${spring.profiles.active:local}")
private String profile;
I wonder if there's actually a Spring Boot property bean - i.e. annotated with @ConfigurationProperties - which holds the…

maxxyme
- 2,164
- 5
- 31
- 48
1
vote
1 answer
How to make both validation annotations in a ConfigurationProperties bean and a @FeignClient interface work together?
Let's say I have this application.yml (which will be environment-dependent e.g. via Spring profiles):
app.remote:
url: http://whatever.url.it.is:8080/
and matching Java-style configuration properties…

maxxyme
- 2,164
- 5
- 31
- 48
1
vote
1 answer
ConfigurationProperties not working with @Getter and @Setter
I am trying to use @ConfigurationProperties with lombok @Getter and @Setter.
If I manually define the getters and setters everything works fine. If I remove the actual getters and setters and add @Getter and @Setter spring cannot find any of the…

Brian
- 556
- 6
- 26
1
vote
0 answers
Spring @Validated annotation prevents @ConfigurationProproperties value injection, why?
I am trying with @ConfigurationProperties and I find two things:
for tests to work, I have to put configuration properties files (yml) in test package; setters and an empty constructor are required.
If I annotated the class with @Validated,…

WesternGun
- 11,303
- 6
- 88
- 157