Nexus 사복 의 구축 원리 및 튜 토리 얼 분석

5697 단어 Nexus사복세우다
1.왜 넥 서 스 사복 을 구축 합 니까?
회사 의 모든 개발 구성원 은 외부 네트워크 가 없고 랜 을 통 해 nexus 사복 을 연결 하 며 사복 으로 외부 네트워크 를 연결 합 니 다.
프로젝트 를 사복 에 발표 하고 다른 사람들 은 사복 에서 다운로드 합 니 다.
2.사복 사용 후 구성 도

3.넥 서 스 구축
3.1 nexus-2.10-1bundle.zip 는 임의의 비 중국어 디 렉 터 리 에 압축 을 풀 었 습 니 다.
3.2 nexus-2.10-1\bin\jsw\\indows-x86-4(자신의 시스템 에 대응)

windows 64 시스템 을 예 로 들 면

instal-nexus.bat 설치 서비스
star-nexus.bat 오픈 서비스
stop-nexus.bat 서비스 정지
  • unistal-nexus.bat 마 운 트 해제 서비스
  • 3.3 백그라운드 로그 인
    브 라 우 저 에 htp:/localhost:8081/nexus 를 입력 하 십시오.
    기본 포트 8081
    기본 사용자 이름 admin
    기본 비밀번호 admin 123
    조정 이 필요 하 다 면 nexus-2.10-1\conf\exus.properties 를 설정 할 수 있 습 니 다.

    4.마 븐 으로 사복 연결
    4.1 maven 의 setings.xml 수정
    
    <?xml version="1.0" encoding="UTF-8"?>
    <settings>
      <localRepository>G:\tool\m2\myrepository</localRepository>
      <mirrors>
    
        <mirror>
          <id>nexus-releases</id>
          <mirrorOf>*</mirrorOf>
          <url>http://localhost:8081/nexus/content/groups/public</url>
        </mirror>
        <mirror>
          <id>nexus-snapshots</id>
          <mirrorOf>*</mirrorOf>
          <url>http://localhost:8081/nexus/content/repositories/apache-snapshots/
          </url>
        </mirror>
      </mirrors>
    
    
      <profiles>
        <profile>
          <id>jdk-1.7</id>
          <activation>
            <activeByDefault>true</activeByDefault>
            <jdk>1.7</jdk>
          </activation>
          <properties>
            <maven.compiler.source>1.7</maven.compiler.source>
            <maven.compiler.target>1.7</maven.compiler.target>
            <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
          </properties>
        </profile>
    
    
    
        <profile>
          <id>nexusTest</id>
          <repositories>
            <repository>
              <id>local-nexus</id>
              <url>http://127.0.0.1:8081/nexus/content/groups/public/</url>
              <releases>
                <enabled>true</enabled>
              </releases>
              <snapshots>
                <enabled>true</enabled>
              </snapshots>
            </repository>
          </repositories>
        </profile>
    
    
      </profiles>
    
    
      <activeProfiles> <!--   id  nexusTest  profile -->
        <activeProfile>nexusTest</activeProfile>
      </activeProfiles>
      <servers>
        <server>
          <id>releases</id>
          <username>admin</username>
          <password>admin123</password>
        </server>
        <server>
          <id>snapshots</id>
          <username>admin</username>
          <password>admin123</password>
        </server>
      </servers>
    </settings>
    G:\tool\\m2\myrepository 로 컬 창고 위치 저장
    http://127.0.0.1:8081 Nexus 서버 ip 및 포트
    admin/admin 123 Nexus 서버 로그 인 사용자 이름과 비밀번호
    5.프로젝트 를 사복 으로 발표 하 는 절차
    5.1 pom.xml 에서 개인 서버 경로 설정
    
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>com.bjsxt</groupId>
      <artifactId>test</artifactId>
      <version>0.0.1-SNAPSHOT</version>
    
      <distributionManagement>
        <repository>
          <id>releases</id>
          <url>http://localhost:8081/nexus/content/repositories/releases</url>
        </repository>
        <snapshotRepository>
          <id>snapshots</id>
          <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>
    
    </project>
    5.2 setings.xml 에 개인 서버 창 고 를 연결 하 는 사용자 이름과 비밀 번 호 를 설정 합 니 다.
    
    <servers>
        <server>
          <id>releases</id>
          <username>admin</username>
          <password>admin123</password>
        </server>
        <server>
          <id>snapshots</id>
          <username>admin</username>
          <password>admin123</password>
        </server>
      </servers>
    5.3 우 클릭 항목->run as 입력 deploy
    항목 에 추가 하면 배경 에서 해당 하 는 가방 을 조회 할 수 있 습 니 다.

    이상 이 바로 본 고의 모든 내용 입 니 다.여러분 의 학습 에 도움 이 되 고 저 희 를 많이 응원 해 주 셨 으 면 좋 겠 습 니 다.

    좋은 웹페이지 즐겨찾기