其他分享
首页 > 其他分享> > maven 私服安装

maven 私服安装

作者:互联网

私服的作用:资源共享,提高同一个局域网下的成员的开发效率,将模块放在私服上,随取随用
Nexus私服下载地址
bin目录下打开命令行,执行 nexus /run nexus 启动服务 ,Started Sonatype Nexus OSS 3.38.1-01 标志着启动成功
url 访问地址 http://localhost:8081/ , 在 etc目录下 nexus-default.properties 是配置文件 ,可以更改主机地址和端口号

新建仓库:选择类型是maven2,记得将仓库放入到仓库组中
maven settings 文件设置私服

<servers>
  <server>
      <id></id>
      <username></username>
      <password></password>
   </server>
</servers>

接着设置 镜像

<mirrors>
    <mirror>
      <id></id>
      <!-- 表明所有的都从私服中取,然后私服向中央仓库去要 -->
      <mirrorOf>*</mirrorOf>
      <!-- 仓库组对应的url -->
      <url>http://localhost:8081/repository/maven-public/</url>
    </mirror>
</mirrors>

pom中配置发布管理

<distributionManagement>
    <repository>
        <id>server的id</id>
        <url>仓库url</url>
    </repository>
    <snapshotRepository>
        <id></id>
        <url></url>
    </snapshotRepository>
</distributionManagement>

deploy 发布到私服

标签:8081,nexus,Nexus,私服,maven,仓库,安装
来源: https://www.cnblogs.com/HypoPine/p/16165913.html