maven多仓库配置

maven多仓库配置(maven install报错 Received fatal alert: protocol_version)

试过很多网上的多仓库配置,90%无效,而且一堆乱七八糟的,自己搞了下测试可用,写的也简单,如果没有参考了无效希望及时反馈及时更改。

1、首先我修改的是setting.xml,完整配置如下: myRepository1 是公司的(没有写ip和端口需要自己替换),myRepository2 是阿里的,<activeProfiles> 标签用来激活仓库,多个仓库对应多个 <profile>标签,其他结构一致。<pluginRepositories>  这个标签是因为在install 是会报一个(Received fatal alert: protocol_version(JDK7) 的错误):其他的解决方案参考下面的连接:https://www.iteye.com/blog/feitianbenyue-2429045

<profiles>
    <profile>
        <!-- id必须唯一 -->
        <id>myRepository1</id>
        <repositories>
            <repository>
                <!-- id必须唯一 -->
                <id>Nexus</id>
               <mirrorOf>central</mirrorOf>
              <name>Nexus Public Repository</name>
              <url>http://ip+端口号/nexus/content/groups/public</url>
                <releases>
                    <enabled>true</enabled>
                    <updatePolicy>always</updatePolicy>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
        </repositories>
        <pluginRepositories>  
            <pluginRepository>  
                <id>Nexus</id>        
                <url>http://ip+端口号/nexus/content/groups/public</url>            
            </pluginRepository>  
        </pluginRepositories>  
    </profile>
    
    <profile>
        <!-- id必须唯一 -->
        <id>myRepository2</id>
        <repositories>
          <repository>
                <!-- id必须唯一 -->
                <id>alimvn</id>
                <!-- 仓库的url地址 -->
                <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
                <releases>
                    <enabled>true</enabled>
                    <updatePolicy>always</updatePolicy>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
        </repositories>
    </profile>
</profiles>
<activeProfiles>
     <!-- 激活myRepository1 -->
    <activeProfile>myRepository1</activeProfile>
    <!-- 激活myRepository2 -->
    <activeProfile>myRepository2</activeProfile>
    <!-- <activeProfile>myRepository3</activeProfile> -->
</activeProfiles>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值