250x250
Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- Python
- STS
- JDBC
- Tomcat
- Spring Boot
- Thymeleaf
- MySQL
- SpringBoot
- PostgreSQL
- oracle
- Exception
- Eclipse
- JavaScript
- MSSQL
- git
- IntelliJ
- 오픈소스
- myBatis
- Open Source
- maven
- AJAX
- error
- jpa
- Docker
- spring
- ubuntu
- Core Java
- 문서
- Source
- 설정
Archives
- Today
- Total
헤르메스 LIFE
[Spring Boot] 개발환경 구축 - Hello Thymeleaf 본문
728x90
개발환경
1. STS 버전 : 4.13.1
2. JDK 버전 : OpenJDK 11.0.14_9_x64
3. Tomcat 버전 : 9.0.71
4. Maven 버전 : 3.8.4
5. Spring 버전 : Spring Boot 2.7.8
6. Thymeleaf 3.0.15
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.8</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>simple.spring</groupId>
<artifactId>SimpleSpringBoot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>SimpleSpringBoot</name>
<description>Simple Spring Boot Project</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
application.properties
#Server port
server.port=8081
server.servlet.context-path=/
#
server.servlet.encoding.enabled=true
server.servlet.encoding.charset=UTF-8
server.servlet.encoding.force=true
# 기본단위 : 초
server.servlet.session.timeout=120
# Spring Default : UTF-8
server.tomcat.uri-encoding=UTF-8
#
spring.thymeleaf.cache=false
logback.xml - 파일명칭이 동일해야 아래의 설정이 적용됩니다.
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="30 seconds">
<!-- 로그 파일이 저장될 경로 -->
<property name="LOG_PATH" value="C:/greenhorn/logs" />
<!--로그 파일 저장 위치 -->
<property name="LOG_FILE_DEV" value="logback-dev#1" />
<property name="LOG_FILE_PRD" value="logback-prd#1" />
<!-- pattern -->
<property name="LOG_PATTERN" value="%-5level %d{yy-MM-dd HH:mm:SSS}[%thread] %logger[%method:%line] - %msg%n" />
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<appender name="ROLLING-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH}/${LOG_FILE_DEV}.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${LOG_PATTERN}</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- Rolling 정책 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- .gz,.zip 등을 넣으면 자동 일자별 로그파일 압축 -->
<fileNamePattern>${LOG_PATH}/${LOG_FILE_DEV}.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- 파일당 최고 용량 kb, mb, gb -->
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- 일자별 로그파일 최대 보관주기(~일), 해당 설정일 이상된 파일은 자동으로 제거 -->
<maxHistory>30</maxHistory>
</rollingPolicy>
</appender>
<logger name="simple" level="debug" additivity="false">
<!-- ref="appender name 지정" -->
<appender-ref ref="CONSOLE" />
<appender-ref ref="ROLLING-FILE" />
</logger>
<root level="debug">
<appender-ref ref="CONSOLE" />
<appender-ref ref="ROLLING-FILE" />
</root>
</configuration>
https://hermeslog.tistory.com/588
https://hermeslog.tistory.com/648
728x90
'Spring Boot Framework' 카테고리의 다른 글
[Spring Boot] Spring Boot 배포전략 (0) | 2023.01.31 |
---|---|
[Spring Boot] 개발환경 구축 - Logback (0) | 2023.01.29 |
[Spring Boot] Embedded Server Port 변경 (0) | 2023.01.29 |
[Spring Boot] Spring Boot + JWT를 이용한 Token 처리 (2) | 2022.03.26 |
[Spring Boot] Spring Boot + Thymeleaf + Thymeleaf Layout Dialect (0) | 2022.03.10 |