maven错误总结

1.公司有私有服的时候,这个时候只有两种方式是导入依赖
一种是在setting文件中配置私有仓库
一种是在pom文件中配置私有仓库

如果你在setting文件中配置了阿里的私有服,然后在pom文件中配置了公司的私有仓库,这个时候maven引入依赖优先从setting文件中配置的私有仓库中导入所需的依赖,而不会从你在pom文件中设置的私有仓库,只有从在setting文件中删除掉自己设置的私有仓库,maven才会从pom中设置的私有仓库中下载依赖.

例如:

    <!--配置maven阿里云仓库开始,不用去改maven的setting -->
    <repositories>
        <repository>
            <id>public</id>
            <name>local private nexus</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>public</id>
            <name>local private nexus</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

2:

错误:

Idea中maven的依赖下面有红色波浪线,IDEA没有错误原因提示.

原因:

可能是包没有下全,因为去maven中查找可以查找到.(下次出现这种问题,可以断网验证一下是不是这个问题)

解决方法:

删除pom文件中的依赖,然后再添加进去,然后重新导入依赖.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值