nexus PW set up, configure, use

Foreword

This article focuses on the nexus PW is set up, configure and use.

1. Download nexu3

wget -P /usr/local https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-3.9.0-01-unix.tar.gz

2. Create a new folder nexus

mkdir /usr/local/nexus

3. Unzip the file to the file you just created folder

tar -zxvf nexus-3.9.0-01-unix.tar.gz -C /usr/local/nexus

4. Modify the port, does not modify the default port 8081

vim /usr/local/nexus/nexus-3.9.0-01/etc/nexus-default.properties

Start nexus: /usr/local/nexus/bin/nexus start
close nexus:/usr/local/nexus/bin/nexus stop

5. Verify

Browser opens http://localhost:8081/, you can change the port, login nexus

Initial accounts: admin, default password: admin123

6. Create a private warehouse, type hosted, hosted set to Allow redeploy



7. Enter maven-public group, will be added to the warehouse just created a public group



Then save.

8. The left jar package upload upload


9. Global Use

In setting configuration image file in maven

<mirror>  
  <id>nexus</id>  
  <name>hqx-nexus</name>  
  <url>http://localhost:8888/repository/maven-public/</url>
  <mirrorOf>central</mirrorOf>    
</mirror>

10. For a project to use, add it in the project pom configuration file

<repositories>
    <!-- 配置nexus远程仓库 -->
    <repository>
      <id>nexus</id>
      <name>Nexus Snapshot Repository</name>
      <url>http://localhost:8888/repository/maven-public/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
</repositories>

CSDN: https://blog.csdn.net/qq_27682773
Jane book: https://www.jianshu.com/u/e99381e6886e
blog Park: https://www.cnblogs.com/lixianguo
personal blog: HTTPS: // www.lxgblog.com

Guess you like

Origin www.cnblogs.com/lixianguo/p/12518375.html