넥서스 설정

1. 개요

    Tomcat7, JDK1.6, nexus 2.2 버전을 기준으로 함

2. 넥서스 설치

  • http://www.sonatype.org/nexus/archived 에서 넥서스 2.2 다운 로드
  • 압축을 풀어 D:\Service\Nexus\nexus-2.2 폴더에 넣는다.

3. Tomcat 설정

    server.xml에 대한 설정

    
    	
    	
    
    				

    Tomcat Connectior의 uriworkermap.properties에 대한 설정

    #/=wlb
    #/*=wlb
    /*.jsp=wlb
    /*.do=wlb
    /*.json=wlb
    
    #----------------------------
    # nexus 설정
    #----------------------------
    /index.html=wlb
    /service/*=wlb
    /content/*=wlb
    /static/*=wlb
    #----------------------------
    
    # Optionally filter out all .jpeg files inside that context
    # For no mapping the url has to start with exclamation (!)
    #!/servlets-examples/*.jpeg=wlb
    #!/*.cfg=wlb
    # Mount jkstatus to /jkmanager
    # For production servers you will need to
    # secure the access to the /jkmanager url
    #
    /jkmanager=jkstatus
    
    				

4. IIS 설정

  • repo.moramcnt.com라는 사이트 생성
  • tomcat 연동을 위해 가상디렉토리 jakarta 를 만든다.
      C:\Program Files\Apache Software Foundation\tomcat-connectors-1.2.37\bin

      nexus-01

5. 톰캣 서비스 구동

    넥서스를 톰캣 서비스로 구동하면 넥서스의 환경설정 파일을 Documents and
    Settings 밑의 Default User에 sonatype-work라는 폴더를 생성하여
    기록한다.
    주의 할 점은 콘솔로 톰캣 구동시에는 로그인한 계정밑에 sonatype-work를
    만들어 실행하므로 착각하면 안된다.
    그리고 Default User는 히든 폴더이므로 탐색기 상단에 있는 주소줄에서
    입력하면 아래와 같이 나타난다.

    nexus-02

6. 로그인 및 패스워드 변경

  • 로그인
      http://repo.moramcnt.com/index.html 로 접속

      nexus-03

      기본 로그인 계정은 admin/admin123 이다.

  • Admin 패스워드 변경
      좌표 메뉴에서 Security > Users 메뉴 선택 한후 오른쪽 마우스를 누르면
      아래와 같이 컨텍스트 메뉴가 나오는데 Set password를 선택하여
      패스워드 변경

      nexus-04

7. 레포지토리 생성

  • Views/Repositories > Repositories 메뉴 선택
  • Add 버튼 > Hosted Repository 선택

    nexus-05
  • Hosted Repository 타입으로 모람프레임워크 릴리즈 레포지토리 생성

    nexus-06
  • Hosted Repository 타입으로 모람프레임워크 스냅샷 레포지토리 생성

    nexus-07
  • Repository Group타입의 외부에 공개할 Public Repositories 생성

    nexus-08

    주의: Ordered Group Repositories에 기본으로 있는 Snapshot, Releases,
    Public Repositories는 제외

8. 사용자 생성

  • Privileges 생성
      Security> Privileges 메뉴에서 Add

      nexus-09

      저장하게 되면 총 4개의 privilege가 추가된 것을 확인할 수 있다. (create, read, update, delete)

      nexus-10
  • Role 생성
      Security > Role 메뉴에서 Add

      nexus-11

      주의 : view privilege를 추가하지 않으면 나중에 로그인 했을 경우 프로젝트의 Public Repositories가 보이지 않는다.

  • 사용자 생성
      Security > Users에서 Add

      nexus-12

9. 새로운 사용자 로그인

    이전에 등록한 사용자로 로그인하여 아래와 같이 나오면 성공

    nexus-13

10. 넥서스 Deploy

  • 메이븐의 Settings.xml 파일 수정

    • 서버 등록

      	
      		moramframework-releases
      		moramcnt
      		XXXX
      	
      	
      		moramframework-snapshots
      		moramcnt
      		XXXX
      	
      							
    • 프로파일 등록

      
      
      	moramframework
      	
      		1.6
      	
      
      	
      		
      			moramframework-release
      			http://repo.moramcnt.com/content/repositories/moramframework-release
      			
      				false
      			
      		
      
      		
      			moramframework-snapshots
      			http://repo.moramcnt.com/content/repositories/moramframework-snapshots
      			
      				false
      			
      		
      	
      
      	
      		
      			moramframework-release
      			http://repo.moramcnt.com/content/repositories/moramframework-release
      			
      				false
      			
      		
      
      		
      			moramframework-snapshots
      			http://repo.moramcnt.com/content/repositories/moramframework-snapshots
      			
      				false
      			
      		
      	
      
      							
    • 프로파일 활성화

      
      	moramframework
      
      							
  • 최상위 pom 파일 수정

    • 플러그인 설정

      
      	org.apache.maven.plugins
      	maven-deploy-plugin
      	2.5
      	
      	   true
      	
      	
      							
    • distributionManagement 설정

      
      
      	
      		moramframework-releases
      		http://repo.moramcnt.com/content/repositories/moramframework-releases
      	
      	
      		moramframework-snapshots
      		http://repo.moramcnt.com/content/repositories/moramframework-snapshots
      	
      
      							
  • 이클립스 배포

      nexus-14

      컴파일시 에러가 날 경우, 보안상에 문제 가 있어서 업로드를 못한것이므로 직접 올린다.