首页 > 代码库 > Nexus3.0+Maven3.3配置

Nexus3.0+Maven3.3配置

环境:Windows10企业版X64

Nexus配置

nexus解压后,启动命令:

bin\nexus.exe /run

若要注册成服务:

bin\nexus.exe install  #安装服务
bin\nexus.exe uninstall #卸载服务

此步完成后,nexus服务已经安装成功,可以在系统服务中设置自动或手动,默认为自动。

net start nexus #启动服务 
net stop nexus #停止服务 

虚拟机堆内存配置文件:

bin\nexus.vmoptions

IP、端口配置文件:

etc\org.sonatype.nexus.cfg

nexus访问首页:

localhost:8081

默认管理员账户/密码:admin/admin123

Maven3配置

 conf/settings.xml内容如下:

    <?xml version="1.0" encoding="UTF-8"?>    
    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"     
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     
              xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">    
        
      <pluginGroups></pluginGroups>    
      <proxies></proxies>    
        
      <servers>    
          <server>    
          <id>nexus-releases</id>    
          <username>admin</username>    
          <password>admin123</password>    
        </server>    
        <server>    
          <id>nexus-snapshots</id>    
          <username>admin</username>    
          <password>admin123</password>    
        </server>    
      </servers>    
        
      <mirrors>     
        <mirror>     
          <id>nexus-releases</id>     
          <mirrorOf>*</mirrorOf>     
          <url>http://localhost:8081/nexus/content/groups/public</url>     
        </mirror>    
        <mirror>     
          <id>nexus-snapshots</id>     
          <mirrorOf>*</mirrorOf>     
          <url>http://localhost:8081/nexus/content/groups/public-snapshots</url>     
        </mirror>     
      </mirrors>     
         
      <profiles>    
       <profile>    
          <id>nexus</id>    
          <repositories>    
            <repository>    
              <id>nexus-releases</id>    
              <url>http://nexus-releases</url>    
              <releases><enabled>true</enabled></releases>    
              <snapshots><enabled>true</enabled></snapshots>    
            </repository>    
            <repository>    
              <id>nexus-snapshots</id>    
              <url>http://nexus-snapshots</url>    
              <releases><enabled>true</enabled></releases>    
              <snapshots><enabled>true</enabled></snapshots>    
            </repository>    
          </repositories>    
          <pluginRepositories>    
             <pluginRepository>    
                    <id>nexus-releases</id>    
                     <url>http://nexus-releases</url>    
                     <releases><enabled>true</enabled></releases>    
                     <snapshots><enabled>true</enabled></snapshots>    
                   </pluginRepository>    
                   <pluginRepository>    
                     <id>nexus-snapshots</id>    
                      <url>http://nexus-snapshots</url>    
                    <releases><enabled>true</enabled></releases>    
                     <snapshots><enabled>true</enabled></snapshots>    
                 </pluginRepository>    
             </pluginRepositories>    
        </profile>    
      </profiles>    
        
      <activeProfiles>    
          <activeProfile>nexus</activeProfile>    
      </activeProfiles>    
         
    </settings>    

 

Nexus3.0+Maven3.3配置