Questions tagged [spring-properties]

166 questions
0
votes
1 answer

Is there a clean way to extract nested properties from an application.properties using @ConfigurationProperties?

I was looking to move away from @Value annotation to using @ConfigurationProperties primarily because I ended up having too many properties so adding all of them in the target class seemed to clutter the class with Value annotations and if I were to…
0
votes
1 answer

Spring PropertySourcesPlaceholderConfigurer beans: resolve property value at runtime

I am loading properties with multiple PropertySourcesPlaceholderConfigurer beans and setting placeholder prefix-es: @Bean public static PropertySourcesPlaceholderConfigurer fooPropertyConfigurer() { PropertySourcesPlaceholderConfigurer…
lainatnavi
  • 1,453
  • 1
  • 14
  • 22
0
votes
1 answer

Springboot - @ConfigurationProperties not populating the class fields

I know similar questions have been asked many times with different variations. I have tried to learn from them and from the available tutorials and try to get it working but I think I am missing something that I am not able to figure out. I want to…
Pawan
  • 1,183
  • 16
  • 29
0
votes
1 answer

Adding spring-boot-starter-data-jpa is missing my profile config

I had a spring boot application with profiles (development and production) it was working fine and I can switch between profiles in application.proprties without any problem, today I had to add spring-boot-starter-data-jpa and mysql-connector-java,…
0
votes
1 answer

SpringBoot complementary configuration file in system directory

I need some help to consume another .yml file that complement the original one in the application. Then I have a file filled by me(dev) however some configuration(as database infos) should be inserted by our clients. The one which is in the…
0
votes
0 answers

location of Bootstrap.properties in Spring Cloud Config application

I was trying to develop Spring Cloud Config server with some properties. So on that site it was mentioned that replace the application.properties file into bootstrap.properties file. Code is given as…
0
votes
1 answer

PropertySource property file is being ignored by scanning env property file

In my spring boot project, I have env property(application-dev.prop) file placed directly under resources folder, this prop file has some connection properties defined. The same connection properties with different value defined in user.properties…
Priya
  • 143
  • 4
  • 17
0
votes
1 answer

Spring Profile Use For Same Bean

Hi I am little bit confusign about using profiles in spring.My Scenario is I have a custom properties file.And It is values changes for each environment(dev,test,prod).I use same bean for each environment.But I want to change values for each…
Bilgehan
  • 1,135
  • 1
  • 14
  • 41
0
votes
2 answers

Spring Properties Defined in File not Resolved

When defining a property in application.properties such as deployment=dev spring.profiles.active=${deployment} Spring is unable to resolve the deployment property correctly. Main : The following profiles are active:…
aarbor
  • 1,398
  • 1
  • 9
  • 24
0
votes
0 answers

Access properties in runtime with dynamic name using spring

I have a properties file that looks like this server.se.host server.se.port server.us.host server.us.port and so on. It's a list of host/port used for different countries (Sweden and US in this example). These can also be set as environment…
Andreas Wederbrand
  • 38,065
  • 11
  • 68
  • 78
0
votes
1 answer

Spring properties: spring.config.additional-location not verriden property values

I'm using this command line in order to start my service locally: mvn -pl rep-digital-api clean compile spring-boot:run \ -Dspring-boot.run.arguments=--spring.config.additional-location=front-pre-props.properties pre profile is activated since…
Jordi
  • 20,868
  • 39
  • 149
  • 333
0
votes
3 answers

@Value field is showing null when second time the class method is called

In my custom annotation, I am taking domains I am going to allow for mail @Documented @Constraint(validatedBy = ValidEmail.CheckIfValidMail.class) //@Constraint(validatedBy = {}) @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER,…
Satish Patro
  • 3,645
  • 2
  • 27
  • 53
0
votes
1 answer

Spring Boot does not correctly load profiles from application.yml

I have a Spring Boot project and I'm injecting values to application.yml via the application.properties (this design makes sense for me since there are a lot of microservices and application.properties is actually a symlink) like this: in…
Lukas Forst
  • 802
  • 1
  • 8
  • 25
0
votes
2 answers

To provide nicer logging when a Spring property is invalid

Using a application.properties file my Spring Boot app can use some property values in it. A way to make sure a mandatory value must present is to add an annotation @Value for the property. The problem with this is the app fails miserably if the…
user1589188
  • 5,316
  • 17
  • 67
  • 130
0
votes
1 answer