Skip to content

넥서스 설정

  1. nuget 리파지토리 제거
    1. 경로
      • Settings -> Repository -> Repositories
    2. 상세보기 상태에서 Delete repository 버튼 클릭
      1. nuget-group
      2. nuget-hosted
      3. nuget.org-proxy
  2. maven 리파지토리 제거 (Optional)
    1. 백앤드 개발을 하지 않는 경우에는 삭제한다.
    2. 경로
      • Settings -> Repository -> Repositories
    3. 상세보기 상태에서 Delete repository 버튼 클릭
      1. maven-central
      2. maven-public
      3. maven-releases
      4. maven-snapshots
  3. npm 리파지토리 생성
    1. 경로
      • Settings -> Repository
    2. 목록 상단의 Create repository 버튼 클릭
    3. npm-group 리파지토리 생성
      1. Recipe 목록에서 npm (proxy) 선택
      2. Name: npm-proxy 입력
      3. Proxy -> Remote storage: https://registry.npmjs.org 입력
      4. Create repository 버튼 클릭해서 저장
    4. npm-hosted 리파지토리 생성
      1. Recipe 목록에서 npm (hosted) 선택
      2. Name: npm-hosted 입력
      3. Create repository 버튼 클릭해서 저장
    5. npm.proxy 리파지토리 생성
      1. Recipe 목록에서 npm (group) 선택
      2. Name: npm-group 입력
      3. Group: Available 그룹의 2개 항목을 Members 그룹으로 이동한다.
        1. npm-proxy
        2. npm-hosted
      4. Create repository 버튼 클릭해서 저장
  1. 넥서스에 익명 접근(Anonymous Access)이 가능하도록 설정한 경우에는 추가로 계정을 만들 필요가 없다.
  2. 넥서스 접근을 위한 추가 계정 생성 절차.
    1. Role 생성
      1. 경로
        • Settings -> Security -> Roles
      2. 목록 상단의 Create Role 버튼 클릭
        1. Type: Nexus role 선택
        2. Role ID : nx-build 입력
        3. Role name : nx-build 입력
        4. Applied Privileges
          1. Modify Applied Privileges 버튼을 클릭해서 Privileges Selection 팝업을 생성한다.
          2. 아래 3개의 권한을 추가한다.
            1. nx-healthcheck-read
            2. nx-repository-view-*-*-*
            3. nx-search-read
        5. Save 버튼 클릭해서 저장
    2. 사용자 생성
      1. 경로
        • Settings -> Security -> Users
      2. 목록 상단의 Create local user 버튼 클릭
        1. ID: 사용자 ID 입력
        2. First name: 개인정보 입력
        3. Last name: 개인정보 입력
        4. Email: 개인정보 입력
        5. Password: 패스워드 입력
        6. Confirm password: 패스워드 입력
        7. Status : Active 선택
        8. Roles : Grant 그룹에 nx-build 추가
      3. Create local user 버튼 클릭해서 저장
  1. 경로
    • Settings -> Security -> Anonymous Access
  2. Access 항목을 설정
  3. Save 버튼 클릭해서 저장
  1. 프런트앤드 설정
    1. .npmrc 파일 생성

      계정 홈 디렉토리에 .npmrc 파일을 생성

      Terminal window
      touch ~/.npmrc
    2. .npmrc 파일 설정
      .npmrc
      registry=${NPM_REPOSITORY_PATH}
    3. 테스트
      Terminal window
      npm login
      $ npm login
      npm notice Log in on ${NPM_REPOSITORY_PATH}
      Username: ${NEXUS_ACCOUNT} 입력
      Password: ${NEXUS_PASSWORD} 입력
      Logged in on ${NPM_REPOSITORY_PATH}.
  2. 백앤드 설정
    1. 리파지토리 경로는 넥서스 기본 설정값을 그대로 사용하였다.
    2. 익명 접근(Anonymous Access)이 가능하계 설정된 경우에는 계정정보를 설정할 필요가 없다.
    3. 라이브러리 다운로드를 위한 공용(public) 레파지토이 설정
    4. 스냅샷을 업로드하기 위한 리파지토리를 설정
    5. 릴리즈 버전은 넥서스 관리자 모드에서 직접 업로드하는 방식으로 등록한다.
      build.gradle
      ...
      ext {
      nexusUrl = 'http://localhost:8081'
      }
      repositories {
      maven {
      credentials {
      username "${NEXUS_ACCOUNT}"
      password "${NEXUS_PASSWORD}"
      }
      url "${nexusUrl}/repository/maven-public/"
      }
      }
      uploadArchives {
      repositories {
      mavenDeployer {
      repository(url: "${nexusUrl}/repository/maven-public/") {
      authentication(username "${NEXUS_ACCOUNT}", password "${NEXUS_PASSWORD}")
      }
      snapshotRepository(url: "${nexusUrl}/repository/maven-snapshots/") {
      authentication(username "${NEXUS_ACCOUNT}", password "${NEXUS_PASSWORD}")
      }
      }
      }
      }
      ...