赞
踩
导入项目时,有些jar包依赖引入不到,这时可能需要你切换maven镜像
进入maven目录,然后进入config文件夹,将setting文件替换成下面内容
<?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"> <localRepository>E:\repository</localRepository> <mirrors> <mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <name>阿里云公共仓库</name> <url>https://maven.aliyun.com/repository/public</url> </mirror> <mirror> <id>planetmirror.com</id> <name>aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors> </settings>
问题描述Idea maven模块中pom.xml文件导包的时候不会自动提示
解决方案:
打开Settings界面,依次找到“Build,Execution,Deployment——>Bulid Tools——>Maven——>Repositories”。
点击如图update按钮,更新Maven仓库索引
PS:该解决方案只适用于已经下载到本地库的情况,本地库没有下载的情况下一般都是没有提示
如果本地仓库在更新出错,那应该就是maven的setting.xml里面的配置出错了,配置的不是url指定的本地仓库,将localRepository改为自己的本地仓库,再去重复上面的操作。ok
<localRepository>E:\repository</localRepository>
这是重点这里开了无语
当然如果还是没有提示可能是开了节能模式了,把下面的power save mode 给关了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。