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>

重启工具再次访问即可

相关推荐
sugar__salt3 天前
Spring、Spring Boot 与配置文件核心知识点详解
java·spring boot·后端·spring·java-ee·maven·intellij-idea
Architect_Lee5 天前
mac安装不同版本的maven
java·maven
BerryS3N5 天前
Java全平台开发环境配置与极速搭建指南(含JDK 8/17/21多版本管理、环境变量深层原理解析、Maven/Gradle构建工具及IDE集成)
java·ide·maven
sugar__salt5 天前
Spring 三层架构与 IoC、依赖注入完全指南
java·spring boot·后端·spring·架构·maven·intellij-idea
还是鼠鼠6 天前
【Spring AI智能体实战 02】Spring Boot 3.4整合Spring AI:项目创建与依赖配置
java·人工智能·spring boot·maven·spring ai
cyadyx6 天前
Nexus管理私服
maven·nexus
程序员钟霖7 天前
【实战版】Spring IOC 控制反转详解
java·后端·spring·maven·intellij-idea
减瓦8 天前
Maven 源码包的下载与工程化落地
java·maven
数聚天成DeepSData10 天前
数聚天成 DeepSData 数据价值落地实战指南
java·maven·devops
自强的小白11 天前
maven高级(聚合和私服)以及私服的上传和下载
java·maven