Spring Boot项目pom.xml父依赖解析失败求助
Hey there, I’ve run into this exact Maven issue before—let’s get your Spring Boot project back on track. The error you’re seeing means Maven tried to pull the spring-boot-starter-parent 2.0.0.RELEASE POM from Maven Central, failed (probably due to a blip in network connectivity, proxy issues, or a temporary repo outage), and then cached that failure so it wouldn’t waste time retrying automatically. Here’s how to fix it:
Step 1: Clear the cached failure files from your local Maven repo
Maven stores a record of failed downloads in your local repository. You need to delete these files to force it to try again:
- Navigate to your local Maven repo path:
- On Linux/macOS:
~/.m2/repository/org/springframework/boot/spring-boot-starter-parent/2.0.0.RELEASE/ - On Windows:
C:\Users\[YourUsername]\.m2\repository\org\springframework\boot\spring-boot-starter-parent\2.0.0.RELEASE\
- On Linux/macOS:
- Delete the files named
_remote.repositoriesand any files ending with.lastUpdatedin that directory.
Step 2: Force Maven to update dependencies
Open your terminal/command prompt, go to your project’s root directory (where the pom.xml lives), and run this command:
mvn clean install -U
The -U flag tells Maven to force update all dependencies, ignoring the cached failure status we just deleted.
Step 3: Verify network and proxy settings (if the above doesn’t work)
If you still get the error, double-check:
- Your internet connection is working, and you can access the Maven Central repo directly in a browser.
- If you’re behind a proxy, make sure your
settings.xml(in~/.m2/or your Maven installation’sconf/folder) has the correct proxy configuration.
Step 4: (Optional) Try a different Spring Boot version
While 2.0.0.RELEASE is a valid version, it’s pretty outdated. If you don’t have a hard requirement to use this specific version, consider upgrading to a more recent stable release (like 2.7.x or 3.x, depending on your Java version) by updating the parent version in your pom.xml:
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.7.15</version> <!-- Or a newer compatible version --> <relativePath/> <!-- lookup parent from repository --> </parent>
Once you’ve done these steps, reload your project in your IDE (if you’re using one—for IntelliJ, click the "Reload All Maven Projects" button in the Maven tool window) and the error should be gone.
内容的提问来源于stack exchange,提问作者Omar Amaoun

