Back-End/Spring

[Spring/스프링] Spring MVC JDK, Java, Servlet 버전 변경 및 업그레이드 방법

728x90

1. pom.xml에서 JDK, Java 버전을 11, Servlet 버전을 3.1로 변경 후 저장한 다음 "프로젝트 우클릭 -> Maven -> Update Project"

<!-- Java -->
<properties>
	<java-version>11</java-version>
	<org.springframework-version>3.1.1.RELEASE</org.springframework-version>
	<org.aspectj-version>1.6.10</org.aspectj-version>
	<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>

<!-- JDK -->
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-compiler-plugin</artifactId>
	<version>2.5.1</version>
	<configuration>
	<source>11</source>
	<target>11</target>
	<compilerArgument>-Xlint:all</compilerArgument>
	<showWarnings>true</showWarnings>
	<showDeprecation>true</showDeprecation>
	</configuration>
</plugin>

<!-- Servlet -->
<dependency>
	<groupId>javax.servlet</groupId>
	<artifactId>javax.servlet-api</artifactId>
	<version>3.1.0</version>
	<scope>provided</scope>
</dependency>

 

2. web.xml 에서 DTD를 3.1로 변경

<?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">

 

3. 프로젝트 우클릭 -> Project Facets -> Dynamic Web Module="3.1", Java Version="11"로 변경

4. 프로젝트 우클릭 -> Project Facets -> Java Compiler -> Compiler Compilance level="11"로 변경

 

5. 이클립스 restart!!

728x90

'Back-End > Spring' 카테고리의 다른 글

[스프링/Spring] Spring MVC 기초  (0) 2021.04.20