Questions tagged [application.properties]

application.properties is the configuration file to configure dynamic properties for the application. It holds configuration properties in the form of key-value pair

application.properties is the configuration file to configure dynamic properties for the application. It holds configuration properties in the form of key-value pair

409 questions
119
votes
6 answers

Intellij IDEA complains cannot resolve spring boot properties but they work fine

Can not resolve configuration property '... I have no problem accessing my properties through the @Value annotation or through an autowired Evironment. But all of my own defined properties get this warning in IDEA. What should I be doing to get…
Stoopkid
  • 1,885
  • 2
  • 17
  • 30
42
votes
3 answers

Precedence order among properties file, YAML file, and Command Line arguments in SpringBoot

I have been using application.properties files since long in my Spring application. But recently I came across application.yaml files. What is the precedence order among all three and advantage (if there is one) of using individual. I know this…
21
votes
2 answers

Quarkus how to set environment variables in application.properties

recently I swapped from thorntail to quarkus and I'm facing some difficulties trying to find how to set environment variables in application.properties in thorntail I used something like this ${env.HOST: localhost} that basically means put…
19
votes
6 answers

Spring Boot: @Value returns always null

I would like to use a value from application.properties file in order to pass it in the method in another class. The problem is that the value returns always NULL. What could be the problem? Thanks in…
Jonathan Williams
  • 237
  • 1
  • 4
  • 12
16
votes
1 answer

Spring-boot application-test.properties

I am trying to unit test the spring-boot application using junit. I have placed the application-test.properties under src/test/resources. I have a ApplicationConfiguration Class which reads the application.properties. My test class looks like…
12
votes
2 answers

Spring-Boot multi module unable to read properties file from another module

I have searched High and low and still I am unable to find a simple answer to this very annoying problem, I have followed this great guide: JWT with multi service app Everything works great but in the end of the guide we are suggested to create a…
Roie Beck
  • 1,113
  • 3
  • 15
  • 30
11
votes
4 answers

Can I override quarkus application.properties value in my test class?

I have a value configured in my quarkus application.properties skipvaluecheck=true Now whenever I want to execute my tests, I want to have this value to be set to false instead of true. But I do not want to change in application.properties because…
Sandra
  • 419
  • 7
  • 17
11
votes
1 answer

Confusion regarding spring.http.multipart.max-file-size vs spring.servlet.multipart.max-file-size

I have spent days wasted getting Spring Boot Upload file to work but, as is always with Spring you have no clue how the magic works and even after years of working with this framework - you have to google tonnes of times to unravel what has gone…
10
votes
4 answers

Spring Boot connection to Postgresql with SSL

I have a Spring Boot application (version 2.1.1) using Postgresql 9.6 as database. I have to connect to the db via SSL with sslmode=verify-ca. What I have done till now is to set in the Application.properties file the…
9
votes
2 answers

spring.session.timeout vs server.servlet.session.timeout

I'm looking to extend the user session in a Spring MVC app with Spring boot and Tomcat. Looking at the documentation there seems to be 2 relevant properties: server.servlet.session.timeout spring.session.timeout Most examples out there seem to…
d0001
  • 2,162
  • 3
  • 20
  • 46
9
votes
1 answer

Heroku Spring application.properties file

I am hosting my Spring boot application on Heroku using git deploy. I have a public git repository and have added my application.properties file to the .gitignore as it contains sensitive details such as an api key and database credentials. What is…
user3371750
8
votes
1 answer

How to use multiple mongodb databases in spring boot application?

In my application, I need to use two MongoDB databases. I don't know how to add 2 MongoDB databases in the application.properties file in the spring application. Here is the application.properties file of my project,…
8
votes
5 answers

convert application.yml file to application.properties

I have my application.yml file as below. How to convert it to application.properties I am trying it but how can i write multiple properties in same file. Its giving me duplicate kery error. --- spring: profiles: peer1 eureka: …
8
votes
4 answers

Could not resolve placeholder 'spring.profiles.active' in value "classpath:/ldap-${spring.profiles.active}.properties"

I am trying read ldap properties from a ldap-TEST.properties file and trying to bind it to a java config class.for that i had specified @PropertSource and defined a static Bean for propertysourcesplaceholderconfigurer. still i am getting the Could…
user2307155
  • 185
  • 1
  • 3
  • 12
8
votes
1 answer

Spring Boot Flyway migration placeholder

Can someone show the right format to use to use application.properties config in Flyway migrations. I'd like to use the username for the datasource config in my application.properties file to grant permissions on a database table (db migration using…
user1016765
  • 2,935
  • 2
  • 32
  • 48
1
2 3
27 28