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>

重启工具再次访问即可

相关推荐
逍遥德3 天前
Maven教程.02-基础-pom.xml 使用标签大全
java·后端·maven·软件构建
逍遥德3 天前
Maven教程.01- settings.xml 文件<profile>使用详解
xml·java·maven
逍遥德3 天前
Maven教程.04-如何阅读Maven项目
java·maven
逍遥德3 天前
Maven教程.03-如何阅读pom.xml文件
xml·java·后端·maven
塔中妖3 天前
Windows 安装 Maven 详细教程(含镜像与本地仓库配置)
java·windows·maven
成为你的宁宁3 天前
Jenkins 自动化部署前后端分离若依项目全攻略:涵盖环境配置、Maven/Node.js 工具安装、GitLab 项目协同,及前后端构建、服务器推送与代码更新验证全步骤
node.js·自动化·gitlab·jenkins·maven
没有bug.的程序员4 天前
依赖治理之巅:Maven 与 Gradle 依赖树分析内核、冲突判定博弈与工程自愈实战指南
java·gradle·maven·依赖治理·冲突判定·依赖树
三无少女指南4 天前
Spring Boot项目中Maven编译参数source、target与release的区别及配置实践
java·spring boot·maven
七夜zippoe4 天前
微服务架构下Spring Session与Redis分布式会话实战全解析
java·redis·maven·spring session·分布式会话
何中应5 天前
从零搭建Maven私服(Nexus)
java·运维·maven