maven私库配置

 

 

1、  修改wrapper.conf文件中的信息

1)      wrapper.conf文件目录

D:\nexus\nexus-oss-webapp-1.9.1.1-bundle\nexus-oss-webapp-1.9.1.1\bin\jsw\conf

2)      修改位置

原:wrapper.java.command=java

修改后:wrapper.java.command=C:\Program Files\Java\jdk1.6.0_32\bin\java

2、  修改端口D:\nexus\nexus-oss-webapp-1.9.1.1-bundle\nexus-oss-webapp-1.9.1.1\conf下的plexus.properties文件

3、  启动nexus服务:

D:\nexus\nexus-oss-webapp-1.9.1.1-bundle\nexus-oss-webapp-1.9.1.1\bin\jsw\windows-x86-32\ Installnexus.bat

4、  配置nexus 
    开启的方式:
       
点击Administration菜单下面的Repositories,将这三个仓库Apache SnapshotsCodehaus SnapshotsMaven CentralDownload Remote Indexes修改为true。然后在这三个仓库上分别右键,选择Re-index,这样Nexus就会去下载远程的索引文件

5、  根据Sonatype 镜像地址.docx配置服务

6、  在组中对ReleaseSnapshot进行分类

7、  添加第3方的pom文件

 

8、  配置maven
   
要让maven使用nexus作为私服,需要做一些设置,使用和原来设置artifactory相似的方法。修改
~/.m2/settings.xml.
   
   
增加nexusprofile


    <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></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </pluginRepository>
        <pluginRepository>
            <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>
        </pluginRepository>
       </pluginRepositories>
    </profile> 
   
修改activeProfiles为:

      <activeProfiles>
        <activeProfile>nexus</activeProfile>
      </activeProfiles>     

你可能感兴趣的:(maven,私服)