처음 Maven 프로젝트를 생성했을 때 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>Spring4</groupId>
<artifactId>testproject</artifactId>
<version>1.0-SNAPSHOT</version> </project>
아래와 같이 dependency에 spring framework를 추가해주고 Import changes(intelliJ)를 했더니!
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion> <groupId>Spring4</groupId><artifactId>testproject</artifactId><version>1.0-SNAPSHOT</version><dependencies><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>4.1.0.RELEASE</version></dependency></dependencies></project>
External Libraries에 SpringFramework의 모듈들이 추가되었습니다!
이렇게 Maven의 pom.xml파일을 통해서 쉽게 필요한 라이브러리를 추가할 수 있다.

댓글 없음:
댓글 쓰기