Skill/spring

[Tomcat] Spring Profile 지정하기 (서버별 설정)

진열사랑 2020. 9. 7. 13:27

참고 : feco.tistory.com/106

 

tomcat/bin 디렉토리에서Linux

catalina.sh 파일 생성 후 아래와 같이 작성

JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active={profile_name}"

 

Window

catalina.bat 파일 생성 후 아래와 같이 작성

JAVA_OPTS=%JAVA_OPTS% -Dspring.profiles.active={profile_name}

 

------------ 적용 -------------

/server/tomcat/bin/catalina.sh 파일에 real, dev 설정되어 있어서

application.properties, application-dev.properties, application-real.properties 구분을 할 수 있다.

 

[okcheon-api] vi /server/tomcat/bin/catalina.sh

 

JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=real -Dfile.encoding=UTF-8 -Xms20 48m -Xmx2048m -XX:MaxPermSize=512m"