日期:2014-05-17  浏览次数:20954 次

nexus windows安装
转自http://nowing.iteye.com/blog/705895
1. 首先下载Nexus
    从官网http://nexus.sonatype.org/download.html下载下载最新版本,因为是在windows上安装,因此下载的是zip版本,大小大概是16m。
   
2. 安装
    简单解压缩下载的zip包到安装目录就可以了。
    可执行文件在%nexus安装目录%"nexus-webapp-1.0.0"binjsw"windows-x86-32下:
        InstallNexus.bat/UninstallNexus.bat是安装/卸载nexus为windows service,如果需要设置nexus为开机自动启动就可以安装为windows service然后设置启动方式为自动。
        Nexus.bat是直接在命令行中启动Nexus,如果不想安装Nexus为windows service,可以用这个文件来手工控制Nexus的启动退出。
       
       
3. 配置nexus

    首先登录,默认地址http://localhost:8081/nexus/,默认用户名密码为admin/admin123.
   
    最重要的一件事情就是开启远程索引下载,索引这个功能实在是太好用了。
   
    nexus默认是关闭远程索引下载功能的,主要是担心会造成对服务器的巨大负担,需要我们手工开启。
   
    开启的方式:
        点击Administration菜单下面的Repositories,将这三个仓库Apache Snapshots,Codehaus Snapshots,Maven Central的Download Remote Indexes修改为true。然后在这三个仓库上分别右键,选择Re-index,这样Nexus就会去下载远程的索引文件。
       
4. 配置maven
    要让maven使用nexus作为私服,需要做一些设置,使用和原来设置artifactory相似的方法。修改~/.m2/settings.xml.
   
    增加nexus的profile:

    <profile>
      <id>nexus</id>
      <repositories>
        <repository>
            <id>nexus</id>
            <name>local private nexus</name>
            <url>http://localhost:8081/nexus/content/groups/public</url>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </repository>
        <repository>
            <id>nexus</id>
            <name>local private nexus</name>
            <url>http://localhost:8081/nexus/content/groups/public-snapshots</url>
            <releases><enabled>false</enabled></releases>
            <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
            <id>nexus</id>
            <name>local private nexus</name>
            <url>http://localhost:8081/nexus/content/groups/public</url>
            <releases><enabled>true</enabled></relea