본문 바로가기
Language/SPRING

[web 프로젝트 만들기] pom.xml 설정

by 박살낼겨 2022. 12. 22.

전부가 아닌 초기 설정이며, 개발하는 과정 중 

 

상황에 맞는 dependency를추가하고 build하여 사용해야 한다.

 

또한, 아래의 버전은 필자의 개발환경의 버전 정보들과 맞췄기에 

 

번거롭지만 에러로그를 보며 버전 정보를 맞추는 방법 밖에 없다.

 

 

[초기설정]

<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>com</groupId>

<artifactId>mavenPro</artifactId>

<packaging>war</packaging>

<version>0.0.1-SNAPSHOT</version>

<name>mavenPro Maven Webapp</name>

<url>http://maven.apache.org</url>

<build>

<finalName>mavenPro</finalName>

<sourceDirectory>src/main/java</sourceDirectory>

<plugins>

<plugin>

<artifactId>maven-compiler-plugin</artifactId>

<version>3.8.0</version>

<configuration>

<source>1.8</source>

<target>1.8</target>

</configuration>

</plugin>

<plugin>

<artifactId>maven-war-plugin</artifactId>

<version>3.2.1</version>

<configuration>

<warSourceDirectory>WebContent</warSourceDirectory>

</configuration>

</plugin>

</plugins>

</build>

 

<!-- 라이브러리 버전 관리 -->

<properties>

<javax.servlet-api-version>2.3.3</javax.servlet-api-version>

</properties>

 

<dependencies>

<dependency>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>3.8.1</version>

<scope>test</scope>

</dependency>

 

<!-- Servlet -->

<dependency>

<groupId>javax.servlet</groupId>

<artifactId>javax.servlet-api</artifactId>

<version>4.0.1</version>

<scope>provided</scope>

</dependency>

<dependency>

<groupId>javax.servlet.jsp</groupId>

<artifactId>javax.servlet.jsp-api</artifactId>

<version>2.3.3</version>

<scope>provided</scope>

</dependency>

<dependency>

<groupId>javax.servlet</groupId>

<artifactId>jstl</artifactId>

<version>1.2</version>

</dependency>

 

<!-- Spring -->

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-context</artifactId>

<version>5.2.22.RELEASE</version>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-webmvc</artifactId>

<version>5.2.22.RELEASE</version>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-dao</artifactId>

<version>2.0.8</version>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-jdbc</artifactId>

<version>5.3.23</version>

</dependency>

 

</dependencies>

 

</project>