티스토리 뷰

Dev/기타

[nexus] 기본 설정

마이스토리 2018. 10. 28. 16:15

설치가이드 : 전자정부 서버개발환경 3.5.0 설치가이드 - http://www.egovframe.go.kr/wiki/doku.php?id=egovframework:dev3.5:svrinstall

                 전자정부 nexus 설치가이드 - http://www.egovframe.go.kr/wiki/doku.php?id=egovframework:dev2:dep:nexus



Nexus 기본개념, 출처 : https://blog.naver.com/yun27jin/220863153227


[Repository Type]

  1. Hosted : 기본 Type으로서 회사 내에서 개발한 jar 파일 또는 회사에서 제품개발을 하기 위해서 구입한 3rd party의 jar 파일을 관리하는 Repository가 이에 속합니다. Nexus에서 기본적으로 제공하는 Hosted Type Repository는 Snapshots(사내 개발용 repository), Releases(사내 제품 repository), 3rd party를 제공합니다.
  2. Proxy : Global Repository처럼 외부 Repository에 대해서 proxy 역할을 합니다. maven의 Central Repository는 매우 느리고, 최신 버전이 올라오는 데 굉장히 오래 걸립니다. 그래서 jboss, springsource 등에서 별도의 maven repository를 구축하여 운영하고 있습니다. 이런 경우에 각 개발자들이 해당 maven repository에 대한 설정을 각각 할 수 있기 때문에 Remote Repository를 외부 오픈소스에 대한 Proxy 서버로서의 역할을 수행할 수 있습니다. Nexus에서 기본적으로 제공하는 Proxy Type Repository는 Google Code, java.net, Maven Central이 있습니다.
  3. Virtual : 서로 다른 타입의 Repository에 대해서 adapter 역할을 합니다. 현재 Nexus는 maven1 repository와 maven2 repository에 대한 atapter 역할만 제공하고 있습니다.
  4. Group : 여러 개의 Repository를 하나로 묶어주는 역할을 합니다.


[Repository]

  1. Snapshots : 빌드등 수시로 릴리즈 되는 바이너리를 배포 하는 장소
  2. Releases : 정식 릴리즈를 통해서 배포되는 바이너리를 저장하는 저장소
  3. 3rd party : 벤더등에서 배포하는 (Oracle,IBM등) 바이너리를 저장해놓는 장소로 특정 솔루션등을 사용할때, 딸려 오는 라이브러리등을 여기에 놓고 사용한다.

  4. Proxy Repository : 원격에 원본 repository가 있는 경우, Local에 캐쉬 용도로 사용한다.

  5. Virtual Repository : Repository Group은 몇 개의 repository를 하나의 repository로 묶어서 단일 접근 URL을 제공한다.

[개념 정리]
  • "Central" repository의 경우 maven repository에서 라이브러리 목록을 index 캐싱 해오고, pom.xml을 통해 실행하는 경우 proxy를 이용해 라이브러리를 다운받아 놓는다.
  • "3rd party" repository는 사용자가 제작한 라이브러리나 벤더에서 제공하는 라이브러리를 저장할 수 있다.
  • "publie" repository는 central 라이브러리와 3rd party 라이브러리를 통합하여 제공. 따라서, pom.xml 에 public 라이브러리를 등록하면 모든 라이브러리를 접근하여 사용할 수 있게 됨.

[Central Repositoy 설정]

configuration 에서 Remote Repository Access > Download Remote Indexes : True설정

[nexus 연결설정]

  • maven settings.xml 에서 설정할 때
   <mirror>
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <name>local nexus repositories</name>
      <url>http://localhost:8080/nexus/content/groups/public/</url>
    </mirror>
  • pom.xml에서 직접 설정할 때.
<repositories>
     <repository>
         <id>public</id>
         <releases>
             <enabled>true</enabled>
         </releases>
         <snapshots>
             <enabled>true</enabled>
         </snapshots>
     </repository>
  </repositories>

<pluginRepositories>
      <pluginRepository>
          <id>central</id>
         <releases>
             <enabled>true</enabled>
         </releases>
         <snapshots>
             <enabled>true</enabled>
         </snapshots>
      </pluginRepository>
  </pluginRepositories>


기타 참조

http://stove99.tistory.com/75 

http://ncanis.tistory.com/357

http://bcho.tistory.com/790



댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31