私服nexus3在windows上的安装与配置

官方文档

https://help.sonatype.com/repomanager3/installation/run-as-a-service

下载、解压

在…/nexus-3.14.0-04-win64/nexus-3.14.0-04/bin 目录下,以管理员身份运行cmd

安装启动本地服务

安装nexus本地服务,启动nexus本地服务

nexus.exe /install nexus3	# 安装 nexus3 服务
sc delete nexus3			# 删除nexus3服务
nexus.exe /start nexus3		# 启动nexus3服务
nexus.exe /stop nexus3		# 停止nexus3服务

在这里插入图片描述
备注:nexus3 是服务名,可以随便取名字的。也就是windows系统中本地服务内的服务名称
在这里插入图片描述

参考文档

https://www.cnblogs.com/hujunzheng/p/9807646.html
https://www.cnblogs.com/sxdcgaq8080/p/7580964.html
https://www.cnblogs.com/happyday56/p/11714802.html
https://www.cnblogs.com/my-king/p/6405421.html
https://www.cnblogs.com/yuxiaole/p/9771613.html

更新索引

https://blog.csdn.net/lusyoe/article/details/52821088

Maven settings.xml 配置

搭建 nexus3 私服的 settings.xml 设置

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
	<!--<localRepository>C:\Users\Administrator\.m2\repository</localRepository>-->
		<localRepository>D:\Program Files\apache-maven-3.6.0\repo</localRepository>
	<interactiveMode>true</interactiveMode>
    <offline>false</offline>
    <pluginGroups>
       
    </pluginGroups>
	
	<!--配置权限,使用默认用户-->
	<servers>
		 <server>
            <id>nexus</id>
            <username>admin</username>
            <password>admin123</password>
        </server>
	</servers>
	<!-- 私服镜像 -->
    <mirrors>
        <mirror>
            <id>maven-public</id>			<!-- 私服 nexus3 的 public 仓库的Name -->
            <name>maven-public</name>	<!-- 私服 nexus3 的 public 仓库的Name -->
            <mirrorOf>*</mirrorOf>	<!-- 之前写的是中央仓库 Url 。* 号代表所有 -->
            <url>http://localhost:8181/repository/maven-public/</url>
        </mirror>
    </mirrors>
	


	<profiles>
	<profile>    
		 <id>jdk1.8</id>    
		 <activation>    
			 <activeByDefault>true</activeByDefault>    
			 <jdk>1.8</jdk>    
		</activation>    
	   <properties>    
			<maven.compiler.source>1.8</maven.compiler.source>    
		   <maven.compiler.target>1.8</maven.compiler.target>    
			<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>    
		</properties>     
	</profile>
  </profiles>
	
</settings>

不搭建私服的 settings.xml 配置

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
	<!--<localRepository>C:\Users\Administrator\.m2\repository</localRepository>-->
		<localRepository>D:\Program Files\apache-maven-3.6.0\repo</localRepository>
	<interactiveMode>true</interactiveMode>
    <offline>false</offline>
    <pluginGroups>
       
    </pluginGroups>
	
	<!--配置权限,使用默认用户-->
	<servers>
		 <server>
            <id>nexus</id>
            <username>admin</username>
            <password>admin123</password>
        </server>
	</servers>
	<!-- 私服镜像 -->
    <mirrors>
		<mirror>
			<id>nexus-aliyun</id>			<!-- 私服的仓库 Group ID -->
			<name>Nexus aliyun</name>
			<mirrorOf>central</mirrorOf>	<!-- 之前写的是中央仓库 Url 。* 号代表所有 -->
			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
		</mirror>
	<!-- 阿里云仓库 -->
      <mirror>
		<id>alimaven</id>
		<mirrorOf>central</mirrorOf>
		<name>aliyun maven</name>
		 <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
	  </mirror>

    <!-- 中央仓库1 -->
	  <mirror>
		 <id>repo1</id>
		 <mirrorOf>central</mirrorOf>
		 <name>Human Readable Name for this Mirror.</name>
		 <url>http://repo1.maven.org/maven2/</url>
	  </mirror>
	<!-- 中央仓库2 -->
	  <mirror>
	  	<id>repo2</id>
	  	<mirrorOf>central</mirrorOf>
	  	<name>Human Readable Name for this Mirror.</name>
	  	<url>http://repo2.maven.org/maven2/</url>
	  </mirror>
    </mirrors>
	


	<profiles>
	<profile>    
		 <id>jdk1.8</id>    
		 <activation>    
			 <activeByDefault>true</activeByDefault>    
			 <jdk>1.8</jdk>    
		</activation>    
	   <properties>    
			<maven.compiler.source>1.8</maven.compiler.source>    
		   <maven.compiler.target>1.8</maven.compiler.target>    
			<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>    
		</properties>     
	</profile>
  </profiles>	
</settings>

nexus3 启动仓库

nexus3 是右边表示可用的仓库,nexus2 是左边表示可用的仓库
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值