@markdown
# Spring Framework 설치하기
____
- 스프링 프레임워크(Spring Framework)는 자바 플랫폼을 위한 오픈소스 애플리케이션 프레임워크로서 간단히 스프링(Spring)이라고도 불린다.
- 동적인 웹 사이트를 개발하기 위한 여러 가지 서비스를 제공하고 있다.
## Maven이란
____
- `Maven`은 내가 사용할 라이브러리 뿐만 아니라 해당 라이브러리가 작동하는데에 필요한 다른 라이브러리들까지 관리하여 네트워크를 통해서 자동으로 다운받아준다.
- `Spring` 라이브러리를 효율적으로 관리해주기위해 사용
## Maven project 환경설정
### 1. Maven 다운로드
- `binary.zip` 아카이브 다운로드([http://maven.apache.org/download.cgi](http://maven.apache.org/download.cgi))
### 2. 시스템 환경변수 설정

- 시스템 변수 새로 만들기

- Path 변수 편집 : `;%M2_HOME%\bin` Maven 폴더의 bin 경로 추가

- `mvn` : maven 설치 확인(cmd 창)

- `mvn -version` : mvn 버전 확인

<br/>
### 3. conf 파일 설정
- 적절한 곳에 `repository` 생성 후 경로 복사

- conf - settings.xml 파일 localRepository 부분에 `<localRepository>D:/Lecture/maven/repository</localRepository>` 추가

<br/>
## Eclipse 설정
____
### 1. xml 경로 설정
- `Windows` - `preferences`
- `User Settings`에서 `Maven` 설치 폴더의 `settings.xml` 설치된 경로 선택

- 설정 이후 `repository` 폴더에 관련 파일을 다운로드 된 것을 확인할 수 있다.

<br/>
### 2. Eclipse Maven 프로젝트 생성
- `create a simple project` 체크

- 프로젝트 생성이 되고 나면 관련 `src` 폴더들이 생긴 것을 볼 수 있다.

<br/>
### 3. Maven dependency 설정하기
- [http://mvnrepository.org](http://mvnrepository.org) 접속 후 `spring-context` 검색
<br/>
- `Maven` 방식의 `.jar` 파일 `dependency` 설정하기

- `Maven` - `dependency` 코드 복사
- `xml` 파일의 <project></project> 태그 사이에 붙여넣기

<br/>
### pom.xml 코드
<pre><code class="xml" style="font-size:14px"><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>Lecture-Spring</groupId>
<artifactId>Lecture-Spring</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.9.RELEASE</version>
</dependency>
</dependencies>
</project>
</code></pre>
'웹 프로그래밍' 카테고리의 다른 글
Spring - DI 자동 주입, AOP (0) | 2017.07.06 |
---|---|
Spring - 핵심 개념(IoC, DI) (0) | 2017.07.05 |
Ajax 사용한 Daum 검색 API 사용하기 (0) | 2017.06.21 |
AJAX 비동기 처리 방식 (0) | 2017.06.20 |
JSP, jQuery로 간단한 텍스트 편집기 만들기 (1) | 2017.06.13 |