【刘新】生产环境之-Nexus私服搭建使用

Nexus私服搭建及使用

[引用一篇比较容易理解的文章]
https://blog.csdn.net/qq_23960445/article/details/82322503

1、本地setting.xml配置

	<server>
      <id>nexus-releases</id>
      <username>lx</username>
      <password>123</password>
    </server>

	<server>
      <id>nexus-snapshots</id>
      <username>lx</username>
      <password>123</password>
    </server>
	<profile>
      <id>dev</id>

      <repositories>
        <repository>
          <id>maven-public</id>
          <url>http://nexus.qichuangjia.com/repository/maven-public/</url>
		  <releases>
              <enabled>true</enabled>
          </releases>
          <snapshots>
              <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>

	  <pluginRepositories>
        <pluginRepository>
            <id>maven-public</id>
            <url>http://nexus.qichuangjia.com/repository/maven-public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
      </pluginRepositories>


    </profile>
  <activeProfiles>
	<activeProfile>dev</activeProfile>
  </activeProfiles>

2、代码pom.xml中配置

	<distributionManagement>
		<repository>
			<id>nexus-releases</id>
			<name>Release</name>
			<url>http://nexus.qichuangjia.com/repository/maven-releases/</url>
		</repository>
		<snapshotRepository>
			<id>nexus-snapshots</id>
			<name>Snapshot</name>
			<url>http://nexus.qichuangjia.com/repository/maven-snapshots/</url>
		</snapshotRepository>
	</distributionManagement>

  • 如图所示
    在这里插入图片描述

过程中可能遇到的问题

  • 401权限不足
  • 403文件过大
    在这里插入图片描述
  • deploy 权限
    nexus 3中,已经没有了能对maven私服进行deploy的默认用户,只有admin和匿名用户。为了让一个角色能够对maven进行deploy,需要向它添加nx-repository-view-maven2-*-edit的权限,同时给它匿名角色所有权限即可。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值