본문 바로가기
Programming

Maven을 위한 Nexus 내부 라이브러리(library) 추가하기

by Chan_찬 2015. 1. 22.
728x90
  1. 기본적으로 Nexus는 설치되어 있어야한다.
  2. nexus에 접속한다.
  3. 기본 id:admin pw:admin123 로그인하고
  4. 3rd Party 클릭
  5. Artifact Upload 탭 클릭
  6. GAV Definition 클릭
  7. GAV Parameters 선택
  8. Group, Artifact, Version 은 pom.xmldependency 설정에 추가하는 내용과 같다.
  9. 아래에 Select Artifact(s) to Upload...로 파일을 선택
  10. Add Artfact를 클릭
  11. 마지막으로 Upload Artifact(s) 클릭




이렇게 되면 우선은 라이브러리 등록은 완료다.

3rd Party 목록을 오른쪽 클릭하면 Re-index가 있다. 클릭
Public Repository 오늘쪽 클릭하고 Re-index 클릭.

Maven에서 local Nexus를 Proxy (Cache) repository로 설정이 안되어 있다면

$MAVEN_HOME/.../settings.xml

위 파일에 <mirrors> section에 아래 내용을 추가한다.

<mirror>

     <id>nexus</id>

     <mirrorOf>*</mirrorOf>

     <name>Local nexus repository.</name>

     <url>http://localhost:8081/nexus/content/groups/public/</url>

</mirror>


프로젝트의 pom.xml에 dependency를 추가한다.

        <dependency>
          <groupId>jdf</groupId>
          <artifactId>requestmon3.5.2</artifactId>
          <version>4</version>
        </dependency>



728x90
728x90
Buy me a coffeeBuy me a coffee

댓글