1. Maven 프로젝트 생성
- Maven Project > webapp으 생성 > Group Id, Artifact Id는 자유 finish
2. Pom.xml
1) 플러그인 추가
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>kr.or.seok</groupId>
<artifactId>naver</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>naver Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>naver</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
* <plugins> 추가시 생기는 오류
2) Maven update
* Maven update 결과
3) Navigator
- project > .setting > org.eclipse.wst.common.project.facet.core.xml 파일 내용 수정
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
// 기존 내용 (버전 수정 필요) <installed facet="jst.web" version="2.3"/>
<installed facet="jst.web" version="3.1"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.8"/>
</faceted-project>
* 혹시 이런 에러가 또 ?
4) web.xml
- Tomcat 버전에 따라 web.xml의 버전이 수정되지 않아서 발생하는 에러
<?xml version="1.0" encoding="UTF-8" ?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<display-name>Archetype Created Web Application</display-name>
</web-app>
5) 다시 Maven update
* 해결!!
이 방법으로 안되시는 분들은 댓글 남겨주세요 ~