解决:Connect to xx.xx.xxx.xx :8081 [/xx.xx.xx.xx] failed: Connection refu sed: connect -> [H

本文详细介绍了在使用Maven进行项目部署时遇到的私服连接失败问题,分析了问题原因并提供了重启服务的解决方案。同时,强调了Maven配置文件setting.xml与项目pom.xml中私服ID一致性的重要性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到教程。

1. 自行启动了个  Nenux 服务。想把本地工程推送到 个人私服,执行命令:mvn deploy 报错:

Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy 
(default-deploy) on project gentle: 
Failed to retrieve remote metadata com:gentle:1.0-SNAPSHOT/maven-metadata.xml:
 Could not transfer metadata com:gentle:1.0-SNAPSHOT/maven-metadata.xml
 from/to user-snapshots (http://xx.xx.xx.xx:8081/nexus/content/repositories/snapshots/):
 Connect to xx.xx.xx.xx:8081 [/xx.xx.xx.xx] failed: Connection refused: connect -> [H

2. 原因: 我的 私服 服务挂了。

重启了一下就 OK 了。

3. 另外注意 :maven 配置文件 setting.xml 中私服 id 要和项目 pom.xml 中配置的 id 一致:
 

1.这是在pom.xml 中:

  <distributionManagement>
        <!--JY - 私服-->
        <repository>
            <id>releases</id>
            <name>Nexus Release Repository</name>
            <url>http://此处是服务器IP:8081/repository/maven-releases/</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <name>Nexus Snapshot Repository</name>
            <url>http://此处是服务器IP:8081/repository/maven-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>



2.这是在 setting.xml 中:

	<servers>			
		<!-- JY 私服配置 -->
		 <server>
		  <id>releases</id>
		  <username>admin</username>
		  <password>admin123</password>
		</server>
		<server>
		  <id>snapshots</id>
		  <username>admin</username>
		  <password>admin123</password>
		</server>
	</servers>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值