本地maven私有库nexus设置

系统使用的系统为win7系统。

1.下载nexus

从官网下载最新版本,下载地址http://www.sonatype.org/nexus/ ,我下载后的压缩包为,将解压后的文件放在F盘(目录可自己选择,最好不要放在系统盘,以免系统恢复时麻烦),解压后的目录如图所示:

文件夹说明:

nexus-2.10.0-02:该文件夹包含了nexus运行需要的文件,如启动脚本、依赖jar包等,该文件夹是非常重要的。

sonatype-work:该文件夹包含了nexus生成的配置文件、日志文件、仓库文件等。

(2)Bundle方式安装nexus

配置环境变量:

新建系统变量,如图:


其中变量值为nexus-2.10.0-02文件夹路径,我的变量值为F:\nexus-2.10.0-02-bundle\nexus-2.10.0-02。

path环境变量中添加如下值:环境变量path值最前面加入如下地址:%NEXUS_HOME%\bin;

在cmd下启动nexus服务:ce 路径 /bin  nexus.exe/run 启动 nexus


(3)设置nexus

访问路径http://localhost:8081/   Login默认的账号/密码为:admin/admin123

添加第三方库 选择Maven2(hosted)


按照系统设置第三方jar库属性


将第三方库添加到maven-public组策略中




(4)第三方库上传jar包步骤



(5)设置maven setting.xml

<server>  
<id>releases</id>  
<username>admin</username>  
<password>admin123</password>  
</server>  
<server>  
  <id>snapshots</id>  
  <username>admin</username>  
  <password>admin123</password>  
</server> 

  </servers>



<!--设置镜像 规定maven中央库的jar包必须从nexus私有库中取得-->
<mirror>    
  <id>nexusMirror</id> 
  <name>all repository of public thirdparty releases</name>  
  <mirrorOf>central</mirrorOf>         
  <url>http://localhost:8081/repository/maven-public/</url> 
</mirror> 
  </mirrors>
  


  <profiles>
   
<profile>
<id>dev</id>
          <repositories>
             <repository>
                 <id>nexus</id>
             
<url>http://localhost:8081/repository/maven-public/</url>
                 <releases>
                    <enabled>true</enabled>
                 </releases>
                 <snapshots>
                    <enabled>true</enabled>
                 </snapshots>
              </repository>
            </repositories>           
            <pluginRepositories>
                <pluginRepository>
                    <id>nexus</id>
           
<url>http://localhost:8081/repository/maven-public/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
 </profiles>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值