Maven 私服(Nexus)构建流程

      最近,公司有个需求,就是构建自己的Maven jar包本地仓库,以此来解决下载jar包网络延迟以及版本管理工作带来的繁琐日常。下面,我就主要来记录一下构建Nexus本地服务器的简要流程及基础使用配置。

1、下载安装Nexus安装文件,我这里是用的是 nexus-2.13.0-01版本。

2、将已下载的nexus文件解压到指定的目录。然后进入nexus/bin/jsw/windows-x86-64,点击install-nexus.bat来安装windows服务器。如果是linux文件,流程类似

3、访问 http://localhost:8081/nexus/(默认端口8081),这里就是私服页面,但是好像并不是所有浏览器都兼容,谷歌没问题

4、界面右上角  Login,默认用户名为 admin  admin123,如果需要修改,左侧Security-》Users-》右键 setpassword设置

5、点击左边Repositories,可以看到一系列仓库类型,我们一般使用3个,分别是Releases,Snapshots和3rd party。这3个仓库风别是装稳定版,开发版和第三方jar包。

6、Maven  setting文件设置:


    
      releases
      admin
      admin123
    

    
        snapshots
        admin
        admin123
    

7、项目pom配置:


    
        releases
        Nexus Release Repository
        http://localhost:8081/nexus/content/repositories/releases/
    
    
        snapshots
        Nexus Snapshot Repository
        http://localhost:8081/nexus/content/repositories/snapshots/
    

值得注意的是:6、7中的id必须一样,否则会报问题,权限或者路径问题

当遇见权限问题:https://www.cnblogs.com/chowmin/articles/3930277.html

8、个人习惯: clean、compile、deploy进行构建


你可能感兴趣的:(Maven 私服(Nexus)构建流程)