본문 바로가기

컴퓨터공학/Spring & Hibernate

Spring> Maven> Repository

메이븐의 원리

Maven은 Maven Central Repository를 가기 전에 local repository를 먼저 검색한다.

local repository 의 위치는 C:\Users\사용자\.m2\repository 에 있다.

 

기본적으로 Maven은 Maven Central Repository를 검색하는데 

https://repo.maven.apache.org/maven2/ 이다.

 

한 번 파일을 다운로드 받으면 local repository에 저장된다.

 

 

 

예를 들어서 pom.xml 에 hibernate를 추가하면

이건 팁으로 오른쪽 클릭후 source 에서 format을 하면 보기좋게 정렬이 된다.

아무튼 local repository 에 있는 org 폴더에 가면 hibernate가 생성된다.

 

 

 

만약에 local repository 파일을 삭제하면 어떻게 될까??

프로젝트 오른쪽 클릭 후 Maven 선택한 다음 Update Project를 하자..

 

 

before after.. 

삭제한 파일이 다시 생성된다.

 

 

 


Central Repository

 

 

https://repo.maven.apache.org/maven2

 

Central Repository:

 

repo.maven.apache.org

central Repository 의 주소는 이거인데 여기에 jar파일이 등록되어 있다. 

maven 이 여기서 다운받는 것이다.