使用nexus搭建Maven私服

使用nexus搭建Maven私服 1.28

  • 下载maven

    • yum install -y maven
      +使用nexus搭建Maven私服

    • 查看是否下载成功

      • mvn -v
      • 使用nexus搭建Maven私服
  • 将素材上传至linux系统中的/development中

    • 使用xftp进行上传
    • 使用nexus搭建Maven私服
  • 解压

    • 使用nexus搭建Maven私服
  • 修改nexus文件

    • vim nexus-2.11.3-01/bin/nexus
    • 使用nexus搭建Maven私服
  • 启动

    • ./nexus start 启动

    • 使用nexus搭建Maven私服

    • 然后访问192.168.1.112:8081/nexus

      • 出现以下页面表示访问成功
      • 使用nexus搭建Maven私服
      • 登录 用户名:admin 密码:admin123
      • 使用nexus搭建Maven私服
  • 修改maven的配置文件

    • cd /usr/share/maven/conf/
    • vim settings.xml
    • 使用nexus搭建Maven私服
  • 运行如下命令

    • cd /development/sonatype-work/nexus/indexer/central-ctx

    +使用nexus搭建Maven私服

    • 删除该目录下的全部文件
      • rm -rf *
  • 使用xftp上传文件

  • 使用nexus搭建Maven私服

  • 停止nexus的运行

    • cd /development/nexus-2.11.3-01/bin/
    • ./nexus stop
      +使用nexus搭建Maven私服
  • 执行以下命令

    • cd /development/sonatype-work/nexus/indexer/central-ctx
    • java -jar indexer-cli-5.1.0.jar -u nexus-maven-repository-index.gz -d indexer
      • 使用nexus搭建Maven私服
  • 删除除indexer目录外的所有文件

    • rm -rf [fileName1] [fileName2] …使用nexus搭建Maven私服
  • 将indexer目录中的所有文件移到跟indexer同级目录

    • cd indexer/
    • mv * …/
  • 重新运行一下nexus

    • cd /development/nexus-2.11.3-01/bin/
    • ./nexus start
  • 然后访问http://192.168.1.112:8081/nexus出现以下情况代表成功

    • 使用nexus搭建Maven私服
  • idea中maven使用nexus时,必须在本地的apache-maven-3.5.0>conf下的settings.xml文件做一下修改(使用nexus私服搭建maven依赖必须时刻开启nexus私服,否则不能使用)
    使用nexus搭建Maven私服