Maven管理
问题1、如何修改本地仓库
问题2、如何修改远程仓库
1、打开Maven安装目录找到conf文件夹下的settings.xml
2、用合适的编辑工具打开settings.xml文件,可以看到几乎所有的代码都被注释掉了。
3、修改<localRepository>你的本地仓库地址</localRepository>
4、在<profiles></profiles>之间添加如下代码
<profile>
<id>dev</id> <repositories> <repository> <id>nexus-aliyun</id> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories>
</profile>
注:本人用的是阿里云的远程仓库,如果你有更好的仓库或者自建的镜像可替换。
上述代码区块不要复制,需要自己编写,否则在使用maven打包项目时可能会报错。
5、在<profiles></profiles>之后添加如下代码
<activeProfiles> <activeProfile>dev</activeProfile> </activeProfiles>