본문 바로가기

[Spring]

[Spring]11월 6일 Spring (Spring framework) 메이븐을 활용해서 라이브러리 세팅

*메이븐(Maven) 활용해서 스프링 라이브러리 세팅하는법

자바 프로젝트를 생성한다 → 자바 프로젝트에 스프링 라이브러리를 세팅 해보자

라이브러리 관리 도구인 메이븐을 활용해 세팅하자.

프로젝트 우클릭  Configure → Convert to Maven Project




메이븐은 우리가 사용하고 싶은 라이브러리를 등록하면 알아서 빌드패스 잡아서 넣어준다.

라이브러리에 대한 식별

group Id, artifact Id, version 의 조합.


무튼 finish 하고 나면 프로젝트안에 pom.xml 생긴다.

pom.xml : 메이븐 설정파일



www.mvnrepository.com

 사이트에들어가서 Spring Context, Spring Core 두개는 꼭필요하다!

저 두개 라이브러리를 복사해서

내 pom.xml 에 등록하자


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

  <artifactId>Spring01_Ex</artifactId>

  <version>0.0.1-SNAPSHOT</version>

  <build>

    <sourceDirectory>src</sourceDirectory>

    <plugins>

      <plugin>

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

        <version>3.3</version>

        <configuration>

          <source>1.7</source>

          <target>1.7</target>

        </configuration>

      </plugin>

    </plugins>

  </build>

  

  <dependencies>

  <dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-core</artifactId>

<version>3.2.8.RELEASE</version>

</dependency>

  

  <dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-context</artifactId>

<version>3.2.8.RELEASE</version>

</dependency>

  </dependencies>

  

</project>



출처 : 삼성SDS멀티캠퍼스

강사 : 홍승길

Email : iccack70@gmail.com