maven私有仓库和公有仓库混合使用

<?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">

复制代码
复制代码
<servers>
    <server>
        <id>private-repo</id>
        <username>用户名</username>
        <password>密码</password>
    </server>
    <server>
        <id>HuaweiCloudSDK</id>
        <privateKey>anonymous</privateKey>
        <passphrase>devcloud</passphrase>
    </server>
</servers>
复制代码
<mirrors>
    <mirror>
        <id>private-repo</id>
        <mirrorOf>central</mirrorOf>
        <name>私有云</name>
        <url>http://10.x.y.z:端口/repository/maven-public/</url>
    </mirror>
    <mirror>
        <id>HuaweiCloudSDK</id>
        <mirrorOf>central</mirrorOf>
        <url>https://mirrors.huaweicloud.com/repository/maven/</url>
    </mirror>
</mirrors>
复制代码
<profiles>
    <profile>
        <id>private-repo</id>
        <repositories>
            <repository>
                <id>private-repo</id>
                <name>private-repo</name>
                <url>http://10.x.y.z:端口/repository/maven-public/</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
    </profile>
​
    <profile>
        <id>HuaweiCloudSDK</id>
        <repositories>
            <repository>
                <id>HuaweiCloudSDK</id>                                <url>https://repo.huaweicloud.com/repository/maven/huaweicloudsdk/</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>HuaweiCloudSDK</id>
                <url>https://repo.huaweicloud.com/repository/maven/huaweicloudsdk/</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>
复制代码
<!-- 激活仓库 -->
<activeProfiles>
    <activeProfile>private-repo</activeProfile>
    <activeProfile>HuaweiCloudSDK</activeProfile>
</activeProfiles>

</settings>

最终效果

相关推荐
Whisper_Sy26 分钟前
Flutter for OpenHarmony移动数据使用监管助手App实战 - 网络状态实现
android·java·开发语言·javascript·网络·flutter·php
乂爻yiyao33 分钟前
1.1 JVM 内存区域划分
java·jvm
没有bug.的程序员1 小时前
Spring Cloud Eureka:注册中心高可用配置与故障转移实战
java·spring·spring cloud·eureka·注册中心
CryptoRzz2 小时前
如何高效接入日本股市实时数据?StockTV API 对接实战指南
java·python·kafka·区块链·状态模式·百度小程序
码农水水2 小时前
中国邮政Java面试被问:容器镜像的多阶段构建和优化
java·linux·开发语言·数据库·mysql·面试·php
若鱼19192 小时前
SpringBoot4.0新特性-BeanRegistrar
java·spring
好好研究3 小时前
SpringBoot - yml配置文件
java·spring boot·spring
学海无涯书山有路3 小时前
Android FragmentContainerView 新手详解(Java 版)
android·java·开发语言
XiYang-DING4 小时前
【Java SE】数据类型、变量、类型转换、运算符以及程序逻辑控制
java·开发语言
闻哥4 小时前
Redis 避坑指南:从命令到主从的全链路踩坑实录
java·数据库·redis·缓存·面试·springboot