You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Boot新手求助:项目构建时父POM无法解析错误

解决Spring Boot项目父POM无法解析的问题

Hey there, let's work through this Maven dependency issue you're hitting. That error message tells us Maven cached a failed attempt to download the Spring Boot parent POM (spring-boot-starter-parent:2.0.0.RELEASE) from Maven Central, so it's not even trying to fetch it again—even if your network is working now. Here are the steps to fix this:

1. 清理Maven缓存并强制更新

Maven stores cached dependencies (and failed download attempts) in your local repository. Let's clear that specific entry and force a fresh download:

  • Option 1: Manual cleanup
    • Find your local Maven repo path:
      • Linux/macOS: ~/.m2/repository
      • Windows: C:\Users\<YourUsername>\.m2\repository
    • Navigate to org/springframework/boot/spring-boot-starter-parent/2.0.0.RELEASE and delete this entire folder.
  • Option 2: Maven command
    • Open a terminal in your project's root directory, then run:
      mvn clean install -U
      
    The -U flag forces Maven to ignore cached failed attempts and re-download all dependencies.

2. Verify your network connection

  • Make sure you can access Maven Central directly: try loading the repo URL in your browser—if it loads, your connection is fine.
  • If you're behind a corporate proxy, you'll need to configure Maven to use it. Edit your settings.xml (located in ~/.m2/ or your Maven installation's conf/ folder) to add proxy details like this:
    <proxies>
      <proxy>
        <id>corporate-proxy</id>
        <active>true</active>
        <protocol>http</protocol>
        <host>your-proxy-host.com</host>
        <port>your-proxy-port</port>
        <!-- Add username/password if required -->
        <!-- <username>proxy-user</username> -->
        <!-- <password>proxy-pass</password> -->
        <nonProxyHosts>localhost|*.your-company-domain.com</nonProxyHosts>
      </proxy>
    </proxies>
    

3. Double-check your project's pom.xml

  • Confirm the parent POM coordinates are correct—your pom.xml should have this section:
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.0.RELEASE</version>
    </parent>
    
  • If 2.0.0.RELEASE is giving you trouble, consider upgrading to a newer, stable version (like the long-term support 2.7.x series). Just change the version to 2.7.15—this might avoid compatibility issues with newer JDKs or network issues with older repo entries.

4. Re-import the project in your IDE

  • IntelliJ IDEA: Click the refresh icon (🔄) in the right-side Maven panel, or right-click your project → Maven → Reload Project.
  • Eclipse: Right-click your project → Maven → Update Project..., then check "Force Update of Snapshots/Releases" and click OK.

These steps should resolve the cached download failure and get your project building properly.

内容的提问来源于stack exchange,提问作者user9520884

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:54:28