标签:lease net pre profile ror lan 开源 color 设置
5.下载Maven仓库索引 手动下载
首先将索引下载到本地,下载地址:nexus-maven-repository-index.zip http://download.csdn.net/detail/pk490525/6520295
解压索引压缩包,将里面内容全部拷贝
关闭当前Nexus私服,打开Nexus目录%Nexus_Home%\sonatype-work\nexus\indexer\central-ctx,首先删除当前目录里所有内容,然后粘贴所下载的索引,最后启动Nexus私服,索引生效。
 <repositories>
        <repository>
            <id>nexus</id>
            <name>my-nexus-repository</name>
            <url>http://127.0.0.1:8088/nexus-2.9.0/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>nexus</id>
            <name>my-nexus-repository</name>
            <url>http://127.0.0.1:8088/nexus-2.9.0/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
    <profiles>    
        <profile>    
          <id>myprofile</id>    
          <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>false</enabled>    
                  </snapshots>    
                </pluginRepository>    
            </pluginRepositories>    
        </profile>    
    </profiles>  
3)配置镜像
maven部署
1) 修改pom文件
在pom文件中添加如下配置:
<servers>    
     <server>    
      <id>my-nexus-releases</id>    
      <username>admin</username>    
      <password>admin123</password>    
    </server>    
    <server>    
      <id>my-nexus-snapshot</id>    
      <username>admin</username>    
      <password>admin123</password>    
    </server>    
</servers> 
3)执行部署
测试的构件项目信息如下:
    <groupId>com.ez</groupId>    
      <artifactId>TestJar</artifactId>    
      <version>1.0</version>    
      <packaging>jar</packaging>    
      <name>TestJar</name>    
从上面的信息中可以看出构件为发布版本,所以部署构件的话会自动部署至releases仓库中。
在命令行中执行:mvn clean deploy
如果之前没用执行过该命令,maven会自动到中央仓库中下载部署所需的插件。最后在命令行中看到如下所示就代表构件已经部署成功。
标签:lease net pre profile ror lan 开源 color 设置
原文地址:http://www.cnblogs.com/mengdou/p/7233426.html