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>

重启工具再次访问即可

相关推荐
sxlishaobin7 天前
Maven Setting详解
java·学习·maven
captain37612 天前
▲统一功能——DispatcherServlet源码分析
java·spring·java-ee·log4j·maven
雪芽蓝域zzs16 天前
第 1 章:IDEA 创建 SpringBoot3.5.16 Maven 项目
java·maven·intellij-idea
雪芽蓝域zzs17 天前
第 1 章:IDEA 全局配置 Maven + 新建 SpringBoot3 Maven 项目
java·maven·intellij-idea
代码什么用17 天前
Maven&Nexus
java·maven
code2cat17 天前
Java工具篇之Maven:从pom.xml到测试通过的JAR
xml·java·maven
CarIise19 天前
Spring 框架:多配置文件、开发方式与 IOC 注解
junit·maven·jar
博风19 天前
eclipse中配置maven,以及在本地使用maven。
java·eclipse·maven
少年的范儿20 天前
IntelliJ IDEA 配置 JDK 21 与 Maven 教程(Windows):开发环境配置与验证
java·jdk·maven·intellij idea
peach22 天前
同样是装依赖,为什么 npm 长成 node_modules,Maven 长成 .m2
npm·node.js·maven