IDEA Maven配置了阿里云代理还是报错

  • IDEA Maven配置了阿里云代理配置不生效
  • IDEA Maven代理找不到包
  • IDEA Maven remote error

我们可能在pom文件中配置了如下内容:

<repositories>
    <repository>
        <id>alimaven-central</id>
        <name>Maven Aliyun Mirror</name>
        <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>

但对一些包来说还是地报错了,实际上阿里云代理不止一个仓库,部分jar包仅在某个库中存在,具体可以查看代理仓库

下面分享一个包含全部阿里云maven代理的配置:

<repositories>
    <repository>
        <id>aliyun-central</id>
        <name>Maven Aliyun Central Mirror</name>
        <url>https://maven.aliyun.com/repository/central</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>

    <repository>
        <id>aliyun-public</id>
        <name>Maven Aliyun Public Mirror</name>
        <url>https://maven.aliyun.com/repository/public</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>

    <repository>
        <id>aliyun-google</id>
        <name>Maven Aliyun Google Mirror</name>
        <url>https://maven.aliyun.com/repository/google</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>

    <repository>
        <id>aliyun-gradle-plugin</id>
        <name>Maven Aliyun Gradle Plugin Mirror</name>
        <url>https://maven.aliyun.com/repository/gradle-plugin</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>

    <repository>
        <id>aliyun-spring</id>
        <name>Maven Aliyun Spring Mirror</name>
        <url>https://maven.aliyun.com/repository/spring</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>

    <repository>
        <id>aliyun-spring-plugin</id>
        <name>Maven Aliyun Spring Plugin Mirror</name>
        <url>https://maven.aliyun.com/repository/spring-plugin</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>

    <repository>
        <id>aliyun-core</id>
        <name>Maven Aliyun core Mirror</name>
        <url>https://maven.aliyun.com/repository/grails-core</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>

    <repository>
        <id>aliyun-snapshots</id>
        <name>Maven Aliyun Snapshots Mirror</name>
        <url>https://maven.aliyun.com/repository/apache-snapshots</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>

设置完后再去更新,总有一个库能有需要的东西。若还不行,则在IDEA控制台使用mvn cleanmvn install强制安装一下。

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值