Maven 설치 및 설정

1. maven 다운로드
주요 기능
다운로드 주소: http://maven.apache.org/download.html
 
2, maven 설치
JDK:jdk1.5
2.1   D: / software / 와 같은 설치 하고 싶 은 위치 로 maven - 2.0.7 - bin. zip 압축 풀기.
2.2 Maven 시스템 환경 변수 설정, M2HOME=D:/software/maven-2.0.7。
2.3 Maven bin 디 렉 터 리 를 시스템 환경 변수 PATH 에 추가,% M2HOME%\bin。
2.4 Maven 의 설치 확인:
    cmd > mvn -version
Maven version 2.0.7 이 설치 되 었 음 을 알려 줍 니 다.
3, Maven 설정
Maven home directory 는 windows 에서 C: \ Documents and Settings \ username \ \. m2 입 니 다.
maven 의 설정 은 세 단계 로 나 눌 수 있 습 니 다:
3.1.project
pom. xml 에 설정 합 니 다.procject configuration 은 현재 procject 에 만 유효 합 니 다.
3.2 .installation
maven 설치 시 설정 합 니 다.
3.3 .user
지정 한 사용자 설정.userconfiguration 은 ${user. home} / m2 / settings. xml 에서 지정 할 수 있 습 니 다.주: 이 파일 은 필수 가 아 닙 니 다. 이 파일 을 찾 을 수 없 을 때 maven 은 기본 설정 을 사용 합 니 다.
이 파일 의 구체 적 인 설정 은 참고 할 수 있 습 니 다. http://maven.apache.org/ref/2.0.4/maven-settings/settings.html
3.4  로 컬 저장 소 설정
로 컬 Repository 의 기본 값 은 ${user. home} /. m2 / reposcory / 입 니 다.user configuration (즉 ${user. home} /. m2 / setting. xml) 에서 로 컬 Repository 를 변경 할 수 있 습 니 다.
설정 은 다음 과 같 습 니 다: < settings > < / settings >
        <localRepository>/path/to/local/repo</localRepository>
메모: 로 컬 Repository 는 절대 경로 여야 합 니 다.
3.5 설정 에이전트
 maven2.0 ,   http request    。   user configuration   ,    :
<settings></settings>     <proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>www.hc360.com</host>
<port>80</port>
<nonProxyHosts>local.net,some.host.com</nonProxyHosts>
</proxy>

http://maven.apache.org/guides/mini/guide-proxies.html
3.5 안전 과 배치 설정
   project ,         Repository,  <distributionmanagement></distributionmanagement>setting.xml    。  ,         
              project 。  ,                server,      id,  id
project Repository 。
  ,  repository              ,      server element         。    
<server>
<id>deploymentRepo</id>
<username>repouser</username>
<password>repopwd</password>
</server>

좋은 웹페이지 즐겨찾기