我的maven索引缺失
- 出现问题时,我想导入MySQL的坐标,发现idea没有提示,开始以为,我的idea联想出了问题,通过检查设置,以及各种尝试,发现并不是,这就很尴尬。。。。
- 后来才知道使我的maven索引丢失了。
以下是我的解决办法
- 我检查了idea中的maven设置
File -> Settings -> Build,Execution,Deployment -> Build Tools -> Maven
检查maven的基础配置,看maven是否正确整合
maven的索引
> File -> Settings -> Build,Execution,Deployment -> Build Tools -> Maven -> Repositories
- 检查maven的索引
- 点击UPDATE,如果是error,那么就要看我们的maven了
我检查了我的maven配置文件settings.xml,重新导入了一份之前的配置文件,回到idea,update后,发现maven索引好用了
- maven的部分配置
配置本地仓库
<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
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<!-- 这里写仓库地址,即下载jar包存放的位置
-->
<localRepository>D:\idea\maven_repository</localRepository>
配置阿里云镜像
<mirrors>
<!-- mirror-->
<!-- 这里配置镜像,一般使用阿里云的, -->
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
<mirror>
<!--This is used to direct the public snapshots repo in the
profile below over to a different nexus group -->
<id>nexus-public-snapshots</id>
<mirrorOf>public-snapshots</mirrorOf>
<url>http://maven.aliyun.com/nexus/content/repositories/snapshots/</url>
</mirror>
</mirrors>