Maven Snoatype Nexus Repositorees 2.6.4版本安装

网上找了好多,2.6版本只能说,不太容易用。至少我这样的菜鸟折腾了好久啊!
目前自己功能基本实现,还有自己的学习过程一并贴出来分享
进入链接:http://www.sonatype.org/nexus/archived 下载所需版本
  (当前操作2.6.4.2)
2、安装,解压缩到一个盘
3、cmd-到解压目录(E:\tools\nexus-2.6.4-02\bin\jsw\windows-x86-32),win7可以shift+鼠标右键直接进入命令窗口。
3.1  - nexus install   3.2  -nexus start  提示successfully后,关闭cmd窗口。有兴趣的话可以去系统服务管理窗口看下nexus是否已经启动
4、默认本地运行的地址:127.0.0.1:8081/nexus  
出现一个pro界面



点击右上角 Log in 按钮
输入帐号密码: admin/admin123
点击左侧目录:
Repositories,出现一个tab




点击Central  在屏幕下方出现的按钮 点击 Configuration 这里可以默认,也可以 override 路径,方便管理(推荐)




点击save
Apache Snapshots/Codehaus Snapshots这2个重复操作,location不需要动一般默认就行
关键是download remote Indexes 改成true
然后点击左上角 refresh,右键点击 repository 点击update index, repair index,
注意 中国连接比较慢,这个点了update以后不要急,更新索引的意思






5、这样基本就可以用了,你可以去官网搜下    snoatype nexus book! 里面有详细setting.xml配置。。

目前book里面写的是
[img][/img]
<mirrors>
  <mirror>
   <!--This sends everything else to /public
标红的IP修改好就好了
  -->
   <id>nexus</id>
   <mirrorOf>*</mirrorOf>
   <url>http:// 192.168.2.xxx:8081/nexus/content/groups/public</url>
  </mirror>
</mirrors>
<profiles>
  <profile>
   <id>nexus</id>
   <!--Enable snapshots for the built in central repo to direct -->
   <!--all requests to nexus via the mirror -->
   <repositories>
    <repository>
     <id>central</id>
     <url>http://central</url>
     <releases>
      <enabled>true</enabled>
     </releases>
     <snapshots>
      <enabled>true</enabled>
     </snapshots>
    </repository>
   </repositories>
   <pluginRepositories>
    <pluginRepository>
     <id>central</id>
     <url>http://central</url>
     <releases>
      <enabled>true</enabled>
     </releases>
     <snapshots>
      <enabled>true</enabled>
     </snapshots>
    </pluginRepository>
   </pluginRepositories>
  </profile>
</profiles>
<activeProfiles>
  <activeProfile>nexus</activeProfile>
</activeProfiles>

6 在 eclipse  mvn install 试试吧!!!

7注意:如果碰到pom.xml报错,说mis什么jar包,你可以去 maven search上面下载到本地
然后 在



增加一个本地的maven jar库。然后根据你的需求填好,save
创建好以后,





Upload一个jar后,点击下面的 Add Artifact---



猜你喜欢

转载自yl23250.iteye.com/blog/1981626