티스토리 뷰
| 개발환경 | |
| Os | Windows 10 |
| IDE | STS 3.9.5 |
| Jdk | 1.8.0_172 |
| Spring | 5.0.9.RELEASE |
| View | Thymeleaf |
1. application.properties
- Spring boot 를 이용시 DB,Logging, Server port 등에 관한 설정을 적용하는 환경설정파일
(application.properties 에 대한 지식이 부족하여 해당내용은 나중에 더 보강해야됨)
- 아래는 현재 글을 작성하면서 사용하고있는 설정들이고 DB나 log 등 추가설정도 가능하다.
- 프로젝트 구조
- application.properties 내용
# =================================================================== # COMMON SPRING BOOT PROPERTIES # =================================================================== #profile name = local, dev, prod spring.profiles.active=local #Server HTTP port server.port = 8080 #THYMELEAF #Apply immediately on web brower refresh spring.thymeleaf.cache=false # SPRING RESOURCES HANDLING (ResourceProperties) spring.resources.cache.period=0
- 설명
1) spring.profiles.active=local :
application-local.properties 의 설정을 읽어온다.(dev 로하게되면 application-dev.properties 의설정을 읽어온다)
저같은 경우는 웹프로젝트를 하다보면 local에서 DB 개발DB, 개발서버에서 DB는 개발DB, 운영서버는 운영DB로 접속정보등을 변경해줘야되고
로그도 개발에서는 보통 DEBUG 까지 사용하기에 아래와같이 설정파일(local,dev,prod 등)을 나누게됨.
2) server.prot = 8080 :
구동되는 서버의 포트 (설정파일을 로컬로 했기에 8088로 된다.)
3) spring.thymeleaf.cache=false :
thymeleaf 사용시 정적리로스안에 있어서 소스를 수정후 새로고침을 해도 되지 않지만 false로 주게되면 새로고침시 내용이 바로 적용된다.
4) spring.resources.cache.period=0 :
resources 디렉토리밑에 들어간 css, js 의 변경사항을 바로 반영
- application-local.properties 내용
# =================================================================== # LOCAL SPRING BOOT PROPERTIES # =================================================================== #Server HTTP port server.port = 8088 #Logback logging.level.com.devhjblog=debug logging.file=./log/local
- application-dev.properties 내용
# =================================================================== # DEV SPRING BOOT PROPERTIES # =================================================================== #Server HTTP port server.port = 8090 #Logback logging.level.com.devhjblog=info logging.file=./log/dev
2. 설명이 잘된 글
'Spring' 카테고리의 다른 글
| Intellij Spring boot Jmx RMI remote objects have benn exported (0) | 2022.09.13 |
|---|---|
| Spring + Mssql + Mybatis 연동 (0) | 2019.12.03 |
| Spring Security 구성하기(2) - 패턴구분 및 로그아웃 (0) | 2019.11.26 |
| Spring Security 구성하기(1) (0) | 2019.11.26 |
| Spring Boot + Maven 웹프로젝트 시작하기_프로젝트생성 (0) | 2018.09.21 |
- Total
- Today
- Yesterday
- quartz 실무 적용
- tomcat gzip
- custom Item writer
- 배치 관리 ui
- cursorAI
- actuator prometheus grafana
- JdbcBatchItem
- spring boot jpa crud
- 배치 모니터링
- cursor ai 프롬프트
- Enum ==
- kafka srping event
- Enum Equals ==
- Enum equals
- no `meta.properties` found in
- kafka oubox
- Spring boot Actuator
- Spring Actuator
- cursor ai 프로젝트
- 잡 스케줄링
- spring boot jpa
- cursor ai
- kafka redis
- 스케줄링 시스템
- quartz spring batch
- oubox pattern
- CompositeItemWriter
- cursor ai crud
- SpringBatch 5.1.1
- spring security
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
