• maven的pom.xml多个仓库配置


    1、单个仓库配置如下,发布到远程仓库的命令是:mvn deploy
    <distributionManagement>
    <repository>
    <id>nexus-releases-local</id>
    <name>Nexus Release Repository</name>
    <url>http://{ip}:{port}/nexus/content/repositories/releases/</url> //配置私服的地址
    </repository>
    <snapshotRepository>
    <id>nexus-snapshots-local</id>
    <name>Nexus RELEASE Repository</name>
    <url>http://{ip}:{port}/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
    </distributionManagement>
     
     2、多个仓库配置如下,发布到远程仓库的命令是:mvn deploy -P {仓库id}
    <profiles>
    <profile>
    <id>chengDu</id> //配置仓库1的id
    <distributionManagement>
    <repository>
    <id>nexus-releases-local</id>
    <name>Nexus Release Repository</name>
    <url>http://{ip}:{port}/nexus/content/repositories/releases/</url> //配置私服的地址
    </repository>
    <snapshotRepository>
    <id>nexus-snapshots-local</id>
    <name>Nexus RELEASE Repository</name>
    <url>http://{ip}:{port}/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
    </distributionManagement>
    </profile>
     
    <profile>
    <id>shenZhen</id> //配置仓库2的id
    <distributionManagement>
    <repository>
    <id>nexus-releases-local</id>
    <name>Nexus Release Repository</name>
    <url>http://{ip}:{port}/nexus/content/repositories/releases/</url> //配置私服的地址
    </repository>
    <snapshotRepository>
    <id>nexus-snapshots-local</id>
    <name>Nexus RELEASE Repository</name>
    <url>http:/{ip}:{port}/nexus/content/repositories/snapshots/</url> //配置私服的地址
    </snapshotRepository>
    </distributionManagement>
    <activation>
    <activeByDefault>true</activeByDefault> //设置默认仓库为仓库2
    </activation>
    </profile>
    </profiles>
     
  • 相关阅读:
    快学Scala-第八章 继承
    快学scala-第七章 包和引入
    快学Scala-第六章 对象
    快学Scala-第五章 类
    快学Scala-第四章 映射和元组
    快学Scala-第三章 数组相关操作
    快学Scala-第二章 控制结构和函数
    快学Scala-第一章 基础
    ReLu(Rectified Linear Units)激活函数
    软件工程的发展史
  • 原文地址:https://www.cnblogs.com/Beyond-Borders/p/12614063.html
Copyright © 2020-2023  润新知