把maven总结一下,放这
Windows下Maven搭建
maven下载:http://maven.apache.org/download.cgi
解压,安装(放文件夹下),
配置环境变量:添加 MAVEN_HOME 环境变量,在path中添加 %MAVEN_HOME%\bin;
设置(setting)
Maven 的setting.xml 文件
仓库位置
<localRepository>D:\Maven\repository</localRepository>
镜像:主要是为了快速,这里使用阿里云的远程仓库地址
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<profile>
<id>nexus-aliyun</id>
<activation>
<!--当前使用的远程仓库为osc-->
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>nexus-aliyun</id>
<!--当前使用的远程仓库地址 -->
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus-aliyun</id>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
</profile>
Intellij IDE配置
Maven 查询依赖 jar 包版本号
又一次从Git上clone自己的代码,出现错误,各种包没有,maven 重新也没有用
最后发现是由于用的其他远程仓库,最后搞乱了,只好删除maven仓库本地的缓存。重新下载