关于nexus的学习

1.首先下载 解压版;

2.将nexus的bin目录路径  写入  环境变量path中;

3.修改 nexus配置文件wrapper.conf  15行  ,指定java.exe文件位置(例如:wrapper.java.command=F:workToolsjavajdk1.8.0_121injava);

4.以管理员身份启动吗,命令行(cmd),如果不以管理员省份运行,可能会报错(wrapper  | OpenSCManager failed - 拒绝访问。 (0x5));

5.输入命令  nexus    ,若 返回:Usage: nexus { console : start : stop : restart : install : uninstall }   ;则可继续;

6.   安装:nexus install  ;

7.   启动:nexus start    ;    

学习博客:

http://blog.csdn.net/fanyuna/article/details/40145827

http://blog.csdn.net/fanyuna/article/details/40145827

简单的走了一遍,综合平时工作中使用的部分,使用的setting.xml重点配置如下:

<localRepository> F:project file.m2
epository</localRepository>    //指定本地maven仓库

    <offline>true</offline>     //指定自动下载相关文件


//设置  nexus账号(id和具体项目中的id一致,见下文)
    <server>
            <id>deploymentRepo1</id>
            <username>admin</username>
            <password>admin123</password>
    </server>

//设置镜像文件(当本地仓库缺少jar包,会从这里下载)
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus2</id>
      <mirrorOf>*</mirrorOf> 
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <!-- <url>http://localhost:8081/nexus/content/groups/public/</url> -->
    </mirror>

  

以下是具体项目中的设置:

    <distributionManagement>
        <repository>
            <id>deploymentRepo1</id>   //这个id需要和  上面的  server中的id一致,才有权限 部署项目到 nexus私库中.
            <url>http://127.0.0.1:8081/nexus/content/repositories/snapshots/</url>
            <!--<url>http://localhost:8081/nexus/content/groups/public/</url>-->
        </repository>
    </distributionManagement>

  

nexus一般为运维人员必备技能,但作为开发人员也需要了解及使用.

原文地址:https://www.cnblogs.com/zqsky/p/6828432.html