idea2025|maven3.9无法访问http私服的解决方案

报错:

bash 复制代码
Non-resolvable import POM: The following artifacts could not be resolved: com.*.boot:txlc-*-dependencies:pom:2026.01-SNAPSHOT (absent): Could not transfer artifact com.*.boot:txlc-*-dependencies:pom:2026.01-SNAPSHOT from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [txlcmaven (http://192.168.10.14:8081/repository/maven-public/, default, releases+snapshots)]

解决:在settings.xml中配置如下:

xml 复制代码
  <mirrors>
	<mirror>
		<!-- 配置私服地址http,注意:默认有一个0.0.0.0的最好删掉 -->
		<id>txlcmaven</id>
		<mirrorOf>*</mirrorOf>
		<url>http://192.168.10.237:8081/repository/maven-public/</url>
		<!-- 针对maven3.9.*允许私服http访问的配置 -->
		<blocked>false</blocked>
	</mirror>
  </mirrors>
  
  <profiles>
    <!-- 针对maven3.9.*允许私服http访问的配置 -->
  	<profile>
        <id>allow-http</id>
        <repositories>
            <repository>
                <id>txlcmaven</id>
                <url>http://192.168.10.237:8081/repository/maven-public/</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
				<allowInsecureProtocol>true</allowInsecureProtocol>
            </repository>
        </repositories>
    </profile>
  </profiles>
  
  <!-- 针对maven3.9.*允许私服http访问的配置 -->
  <activeProfiles>
    <activeProfile>allow-http</activeProfile>
  </activeProfiles>

重启工具再次访问即可

相关推荐
飞雪金灵4 小时前
mac电脑 Maven下载安装和配置环境变量
macos·maven·maven下载安装·mac电脑环境
.Hypocritical.1 天前
Maven笔记——2
java·笔记·maven
遨游DATA2 天前
Maven dependencyManagement 已声明却仍缺 Jar:如何验证最终运行包
java·spring boot·maven·故障排查·依赖管理
silence2504 天前
Maven 中 -U 参数是否会强制更新所有依赖?dependency:purge-local-repository 如何重新下载 RELEASE 版本依赖
maven
chexus4 天前
Docker 镜像瘦身:使用 Maven 拆分 Jar 包
docker·maven·jar
码智社4 天前
Maven 零基础完整教程
java·开发语言·maven
半夜修仙4 天前
Spring集成邮箱功能
java·开发语言·spring boot·spring·rabbitmq·github·maven
曾阿伦4 天前
Maven 构建工程化指南
java·maven
南大白5 天前
Maven Lifecycle 生命周期各阶段含义
java·maven
AgCl236 天前
JavaWeb个人笔记01--Maven到MyBatis
笔记·maven·mybatis