웹 프로젝트 시작
환경설정
OpenJdk 1.8.0_191
Tomcat 8.5.57 64bit
Maven 3.6.3
Editor
Eclipse 64bit (최신버전)
이클립스 설정
Window > Preferences
-- Local Repository 변경방법
-- Maven 설치 settings에 localRespository 태그 추가
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<localRepository>D:/Enviroment/repository</localRepository>
생성된 Project > right click > Properties
-Dynamic Web Module > Runtimes > Tomcat 지정
--Version 3.1 : Tomcat 8.5
--Version 4.0 : Tomcat 9
Project Xml 설정
-src > main > webapp > WEB-INF > web.xml > 2라인
-- version, xsd 값 변경
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee https://java.sun.com/xml/ns/javaee/web-app_3_1.xsd">
-- </web-app> 위에 설정 추가
<!-- UTF-8 관련 파라미터 설정 -->
<filter>
<filter-name>encodingFilterUTF8</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilterUTF8</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- beans 관련 설정 -->
<context-param>
<param-name>spring.profiles.active</param-name>
<param-value>dev</param-value>
</context-param>
<context-param>
<param-name>spring.profiles.default</param-name>
<param-value>dev</param-value>
</context-param>
<context-param>
<param-name>spring.liveBeansView.mbeanDomain</param-name>
<param-value>dev</param-value>
</context-param>
- pom.xml 설정
-- 10라인 properties 수정
-- 스프링 및 자바버전 수정
<properties>
<java-version>1.8</java-version>
<org.springframework-version>5.2.7.RELEASE</org.springframework-version>
<org.aspectj-version>1.9.4</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
-- pulgin : org.apache.maven.plugins 수정 ( 거의 맨아랫줄 )
-- <source>, <target> : ${java-version}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
설정 후 재부팅 > 정상적으로 뜨면 완료