개발에서는 http로 운영은 https로 하기위해 스프링부트 설정파일을 분할하기로함

spring.profiles.active 속성은 Spring Boot 애플리케이션을 실행할 때, 명령행 인수, 환경 변수, JVM 시스템 프로퍼티 등을 통해 지정할 수 있습니다.
Spring Boot 애플리케이션을 실행할 때 --spring.profiles.active=프로파일이름 옵션을 추가합니다.
css$ java -jar your-app.jar --spring.profiles.active=dev
SPRING_PROFILES_ACTIVE 환경 변수를 설정합니다.
shell$ export SPRING_PROFILES_ACTIVE=dev
$ java -jar your-app.jar
-Dspring.profiles.active=프로파일이름 JVM 시스템 프로퍼티를 설정합니다.
ruby$ java -Dspring.profiles.active=dev -jar your-app.jar
위와 같이 속성을 지정하면, Spring Boot 애플리케이션에서 spring.profiles.active 속성에 지정된 프로파일에 맞는 설정 파일을 로드합니다. 예를 들어, spring.profiles.active=dev로 설정된 경우, application-dev.properties 파일이 로드됩니다.
java -Dspring.profiles.active=dev -jar your-app.jar 이걸로 잘 작동함
나는 지금 개발환경이 vscode여서
launch.json파일 변경이 필요했음
작업폴더/.vscode/launch.json에
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "WebApp",
"request": "launch",
"mainClass": "comcccccApp",
"vmArgs": "-Dspring.profiles.active=dev",
"projectName": "back"
}
]
}
추가로 개발모드에서는 application-dev.properties 설정을
운영에서는 java -Dspring.profiles.active=prod -jar your-app.jar application-prod.properites 설정을 사용하기로 함
\src\main\resources 폴더 아래에설정파일들
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2023-03-27 오후 4:24 static
d----- 2023-03-27 오후 4:24 templates
-a---- 2023-03-27 오후 5:39 3097 application-dev.properties
-a---- 2023-03-27 오후 6:00 3258 application-prod.properties
-a---- 2023-03-27 오후 5:39 375 application-test.properties
-a---- 2023-03-27 오후 5:54 3132 application.properties
-a---- 2023-03-08 오후 9:26 407 logback.xml
-a---- 2023-03-02 오후 2:58 473 tailwind.config.js