Where is the application.properties file in a Spring Boot project?

后端 未结 4 855
攒了一身酷
攒了一身酷 2020-12-15 02:19

I started a new Spring boot project, I want to change the port number and I read that I have to modify the /resource/application.properties to do so.

I

4条回答
  •  春和景丽
    2020-12-15 03:01

    You can also create the application.properties file manually.

    SpringApplication will load properties from application.properties files in the following locations and add them to the Spring Environment:

    • A /config subdirectory of the current directory.
    • The current directory
    • A classpath /config package
    • The classpath root

    The list is ordered by precedence (properties defined in locations higher in the list override those defined in lower locations). (From the Spring boot features external configuration doc page)

    So just go ahead and create it

提交回复
热议问题