zoukankan      html  css  js  c++  java
  • Maven之--安装nexus 私服

    开始搜索下载了,nexus3.19版本,下来之后,建立一个maven 骨架过程 quickstart,提示没有lgf4j依赖和和maven插件都没有,开始搜索什么原因,猜想是nexus没有索引,右搜索全网,可以手动导入索引,于是找三个文件

    • nexus-maven-repository-index.gz
    • nexus-maven-repository-index.properties
    • indexer-cli-5.1.1.jar

    指令java -jar indexer-cli-5.1.1.jar -u nexus-maven-repository-index.gz -d indexer

    http://maven.apache.org/repository/central-index.html 上述文件的下载地址

    接着试了半天手动更新索引不行,原来是3.X高版本取消了手动更新索引更能,只能卸载3.19nenux,选择安装的2.14.5,正是坑b,全网搜索3.19都没有手动更新索引的信息,还需研究为什么不自动更新索引

    手动更新索引

    [1] 关闭 nexus 服务。
    [2] 清空 {nexus-xxx}…sonatype-workindexercentral-ctx 下的所有文件。
    [3] 拷贝刚生成的 indexer 文件夹下的所有文件到上面的目录。
    [4] 启动 nexus 服务。 双击start-nexus.bat

    然后在maven的seting.xml中设置

    <mirror>
      <id>maven-public</id>
      <mirrorOf>*</mirrorOf>
      <name>localhost nexus</name>
      <url>http://localhost:8081/nexus/content/groups/public/</url>
    </mirror>
    

    z url有没有眼熟和阿里镜像一样说明,ali也用的nexus2

    接着在idea中新建maven quickstart工程就可以了

    有了索引之后,蹭蹭蹭很快就下完了,看下载地址为自己的私服 

    为了deploy 还需要在pom.xml中

    <distributionManagement>
        <repository>
            <id>releases</id>
            <name>Nexus Release Repository</name>
            <url>http://localhost:8081/nexus/content/repositories/releases/</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <name>Nexus Snapshot Repository</name>
            <url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>
    

      w: 上面的id是唯一的(带复看)

  • 相关阅读:
    考研机试 45.skew数
    考研机试 39.大整数因子
    考研机试 37.小白鼠排队
    考研机试 36.中位数
    考研机试 35.最简真分式
    考研机试 30.进制转换
    软工实践第一次作业
    [CF767D] Cartons of milk
    [CF687C] The Values You Can Make
    [CCPC2020绵阳H] Hide and Seek
  • 原文地址:https://www.cnblogs.com/zytcomeon/p/14145808.html
Copyright © 2011-2022 走看看