IDEA / eclipse project to create a spring-boot configuration file to specify the load at startup

eclipse

Right-click on the project -> Run As-> Run Configurations-> Java Application 

Right-click Java Application ----> Click the new

Fill in your name to be defined in the Name of the arrow points (best to use Spring Boot project name)

Fill in your path to start classes at the Main class at the arrow points

Configuration parameters: 

Two ways:

Method a: Specify items using application-test.yml startup, click Arguments Program arguments of configuration parameters

'--spring.profiles.active=test'即可; 

Method two: designated with application-test.yml start, click Arguments VM arguments of configuration parameters

'-Dspring.profiles.active=test'即可; 

 

IDEA

Click Project -> top toolbar RUN -> edit Configurations ---> Templates ---> Application, select the main class, Program arguments configuration

= the Test --spring.profiles.active
----------------
Disclaimer: This article is CSDN blogger original article "0-18-0", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/qq_26702601/article/details/88836177

发布了51 篇原创文章 · 获赞 82 · 访问量 95万+

Guess you like

Origin blog.csdn.net/xiyang_1990/article/details/104578195