今天花了点时间 配置了一个本地仓库 主要是方便自己开发使用。
使用的 nexus 私服 maven idea15
nexus的配置 我贴一个别人的教程吧,写的很详细。 我会附上自己的配置,以及今天犯错的地方,可能大家也会犯错吧。
首先需要的的 nexus , jdk , maven idea15 等 就不一一说明了,这些网上大把都是。
附带个nexus 下载链接:http://www.sonatype.org/nexus/go/
打开目录nexus-2.4.0-09-bundle\nexus-2.4.0-09\bin\jsw 这个目录下面你会发现有很多系统版本的nexus环境
我的电脑是win10 (64)为的系统,所以我选择的是windows-x86-64这个版本,当然可以根据个人的电脑系统选择对应的版本
在这个文件夹下面有对应的 控制台 安装服务 启动 停止 卸载等的启动文件 (右键管理员启动吧!) 很直接明白的。
另外就是需要配置一下nexus\nexus-2.11.4-01\bin\jsw\conf 文件夹下的wrapper.conf 中
# Set the JVM executable
# (modify this to absolute path if you need a Java that is not on the OS path)
wrapper.java.command= C:\Program Files\Java\jdk1.8.0_31\bin\java (记得 后面的java 不要丢了!)
其他就基本差不多了 ,贴上一个个人觉得很详细的 nexus 配置教程 :
链接:http://www.blogjava.net/xiaomage234/archive/2012/11/22/391770.html
配置过程中需要注意的点:
1:Download Remote Indexes改为true
2:group其实是一个虚拟的仓库,就是public 资源库 加源是 添加到左边,看了很多教程 都没说清楚。
3:改完save 之后 ,记得repair index。
然后贴一下 自己的配置文件:
<mirrors> <mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> <name>Nexus Mirror</name> <url>http://localhost:8081/nexus/content/groups/public</url> </mirror> </mirrors> <profiles> <profile> <id>nexus</id> <repositories> <repository> <id>nexus</id> <name>Nexus</name> <url>http://localhost:8081/nexus/content/groups/public</url> <releases><enabled>true</enabled><updatePolicy>always</updatePolicy></releases> <snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>Nexus</name> <url>http://localhost:8081/nexus/content/groups/public</url> <releases><enabled>true</enabled> <updatePolicy>always</updatePolicy></releases> <snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <activeProfiles> <activeProfile>nexus</activeProfile> </activeProfiles>
这三块分别按照对应位置修改即可。 现在可以建一个project 试试了。