接上一篇maven
1. http://www.sonatype.org/nexus/go 下载 nexus解压ui
2.添加环境变量 将E:\nexus\nexus-2.8.1-01\bin 添加到path中this
3. 按操做安装启动url
http://localhost:8081/nexus/进入 能进说明安装成功。 默认 帐号admin admin123
spa
4.修改maven目录下repo中的settings.xml 配置文件code
<mirrors> <!--设置nexus为镜像--> <mirror> <id>nexusMirrors</id> <!--全部访问都执行这个url--> <mirrorOf>*</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://localhost:8081/nexus/content/groups/public/</url> </mirror> </mirrors>
<!--用来覆盖meven中自带的中心仓库 maven中maven-model-builder-3.2.2.jar中有个poi.xml 里面有内容,若是本地仓库和nexus仓库中都没有则再也不向maven仓库去下载-->xml
<profiles> <profile> <id>centralProfile</id> <repositories> <repository> <id>central</id> <name>central Repository</name> <!--http://*也能够好像--> <url>http://central</url> <layout>default</layout> <releases> <enabled>true</enabled> </releases> <!--修改原来默认不下载snapshots 版本的包--> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> </profiles>
<!--开启profile-->
it
<activeProfiles> <activeProfile>centralProfile</activeProfile> </activeProfiles>