2013년 5월 29일 수요일

Maven - settings.xml 분석(전자정부표준프레임워크에서 제공하는 setting.xml기준)


1. settings : 최상 위 엘리먼트로, 하위 엘리먼트들로 메이븐을 설정함.

2. localRepository : 로컬 레파지토리 경로를 지정해주는 element

ex)
<localRepository>경로</localRepository>

3. pluginGroups : pom.xml에 groupId가 명시적으로 설정되어 있지 않을 때 플러그인을 찾을 곳이다.(pom.xml에 plugin에 groupId를 모두 명시해 놨다면 아무 기능도 하지 않는다.)

ex) 
<pluginGroups>
<pluginGroup>com.atlassian.maven.plugins</pluginGroup>
</pluginGroups>


4. mirrors : 저장소에 대한 다운로드 mirror를 설정하는 속성.(repository서버에 연결 시켜 두면 pom.xml에 지정해 둔 라이브러리들을 해당 mirror에서 다운 받을 수 있다. 80포트가 막혔고, 내부에 repository 서버가 존재한다면 용이하며, repository 서버는 주로 nexus를 사용하는 경우가 많다.)

※ mirrors 하위 element
(1) mirrorOf : 주로 central로 사용됨. 해당 mirror의 설명인 듯 
(2) name : mirror 이름
(3) url : mirror 경로
(4) id : mirror id

5. profiles : JDK버전 별 혹은 OS 마다 빌드 구성을 달리 할 수 있게 설정 해주는 것(전자정부표준프레임워크에서 제공하는 setting.xml에는 profiles기능을 사용하지 않는다.)

※ profiles 하위 element
(1) profile : 지정 할 JDK 버전이나 OS에 따른 profile
(2) activation :  JDK버전이나 OS를 입력해주기 위한 상위 element
(3) jdk : JDK 버전 입력
(4) id : 현재 설정할 빌드 구성에 대한 ID 값
(5) repositories : 빌드하기 위해 사용 할 repository 정보

6. activeProfiles : 위에 지정해 둔 profiles의 profile id와 매칭되어 아래 예와 같이 정의하면, 해당 profile로 빌드가 된다. 여러개를 정의해노면 설정한 순서대로 빌드가 된다.

ex)
   <activeProfiles>
     <activeProfile>dev</activeProfile>
</activeProfiles>

7. servers : 서버와 관련 된 설정으로, 주로 인증하는 방법을 제공. 이것을 통해 서버 당 인증 정보를 담고 있을 수 있다.(nexus같은 repository서버를 의미) - setting.xml에서 서버 id 및 인증에 대한 정보를 정의하고, pom.xml에서 서버 id, url을 지정한다.(우리 회사 nexus의 예를 들면 : http://kibi2013.codns.com:7070/nexus/xxx/xxx/xxx 정도가 될 수 있겠다.)  - setting.xml 단에서 username,과 password만 정의 해놓고 pom.xml에서 url 셋팅을 할 수 있다. 매핑은 서버 id로 매핑한다. 

※ servers 하위 element
(1) server : 하나의 server당 이 element를 사용
(2) id : 지정한 서버에 대한 아이디 값(unique) - 이 아이디는 pom.xml에서 repository 서버를 사용하기 위해 선언할 때 해당 repository id와 일치해야 한다.
(3) username : 해당 서버의(nexus) 아이디
(4) password : 서버 id에 대한 비밀번호

참조한 사이트 http://whiteship.tistory.com/1946

댓글 없음:

댓글 쓰기