• docker 快速搭建Nexus3


    1.拉取镜像

    docker pull sonatype/nexus3 

    2.启动容器

    sudo docker run -d --name nexus3 --restart=always -p 8088:8088 -p 8081:8081 -p 5000:5000 -v /mnt/gv0/nexus-data:/nexus-data sonatype/nexus3

    3.修改maven settings.xml 这里使用默认用户名 admin 密码 admin123

    <?xml version="1.0" encoding="UTF-8"?>
    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <localRepository>H:localRepository</localRepository>
    
    <pluginGroups></pluginGroups>    
      <proxies></proxies>    
        
      <servers>
         <server>
          <id>nexus</id>
          <username>admin</username>
          <password>admin123</password>
        </server>
    
        <server>
          <id>maven-public</id>
          <username>admin</username>
          <password>admin123</password>
        </server>
    
        <server>
          <id>maven-releases</id>
          <username>admin</username>
          <password>admin123</password>
        </server>
    
        <server>
          <id>maven-snapshots</id>
          <username>admin</username>
          <password>admin123</password>
        </server>
    
        <server>
          <id>3rd-part</id>
          <username>admin</username>
          <password>admin123</password>
        </server>
    
        <server>
          <id>maven-central</id>
          <username>admin</username>
          <password>admin123</password>
        </server>
       
    
      </servers>
    
     <mirrors>
       <mirror>
          <id>maven-public</id>
          <name>public</name>
          <mirrorOf>central</mirrorOf>
          <url>http://192.168.91.137:8081/repository/maven-public/</url>
        </mirror>
    
        <mirror>
          <id>maven-releases</id>
          <name>releases</name>
          <mirrorOf>central</mirrorOf>
          <url>http://192.168.91.137:8081/repository/maven-releases/</url>
        </mirror>
    
        <mirror>
          <id>maven-snapshots</id>
          <name>snapshots</name>
          <mirrorOf>central</mirrorOf>
          <url>http://192.168.91.137:8081/repository/maven-snapshots/</url>
        </mirror>
    
       <mirror>
          <id>3rd-part</id>
          <name>3rd-part</name>
          <mirrorOf>central</mirrorOf>
          <url>http://192.168.91.137:8081/repository/3rd-part/</url>
        </mirror>
    
           <mirror>
          <id>maven-central</id>
          <name>maven-central</name>
          <mirrorOf>central</mirrorOf>
          <url>http://192.168.91.137:8081/repository/maven-central/</url>
        </mirror>
     </mirrors>
    
    <profiles>
      <profile>
          <id>nexus</id>
          <repositories>
            <repository>
              <id>nexus</id>
              <url>http://192.168.91.137:8081/repository/maven-public/</url>
              <releases>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
              </releases>
              <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
              </snapshots>
            </repository>
          </repositories>
          <pluginRepositories>
            <pluginRepository>
              <id>nexus</id>
              <url>http://192.168.91.137:8081/repository/maven-public/</url>
              <releases>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
              </releases>
              <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
              </snapshots>
            </pluginRepository>
          </pluginRepositories>
        </profile>
      </profiles>
    
    <activeProfiles>
        <activeProfile>nexus</activeProfile>
     </activeProfiles>
    
    </settings>

    4.如果项目需要发布到nexus,修改pom 添加以下 distributionManagement 内容

    <?xml version="1.0" encoding="UTF-8"?>
    <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>org.lzw</groupId>
        <artifactId>idworker</artifactId>
        <version>1.0-SNAPSHOT</version>
    
        <distributionManagement>
    
            <repository>
                <id>maven-releases</id>
                <name>maven-releases</name>
                <url>http://192.168.91.137:8081/repository/maven-releases/</url>
            </repository>
    
            <snapshotRepository>
                <id>maven-snapshots</id>
                <name>maven-snapshots</name>
                <url>http://192.168.91.137:8081/repository/maven-snapshots/</url>
            </snapshotRepository>
    
        </distributionManagement>
    
    </project>

    5.发布

    登录进入  http://192.168.91.137:8081 页面查看 默认用户名 admin 密码 admin123

  • 相关阅读:
    React生命周期及事件详解
    系统重装后常见的环境变量配置
    Java 字符串格式化
    React Native实战系列教程之自定义原生UI组件和VideoView视频播放器开发
    java-json与js-json转化
    RN项目中缩进处理
    React Native 常用学习链接地址
    React-Native 常用组件学习资料链接
    Swift-继承、构造器、类型转换(嵌套)、类扩展、泛型、协议
    CallKit详解(来电提醒+骚扰拦截)
  • 原文地址:https://www.cnblogs.com/sweetchildomine/p/8778155.html
Copyright © 2020-2023  润新知