Fixing "Package org.springframework.boot Does Not Exist" in Maven


Introduction
If you encounter the error "Package org.springframework.boot does not exist" in your Maven-based Spring Boot project, it means Maven cannot resolve Spring Boot dependencies. This issue commonly occurs due to incorrect Maven configuration, missing repositories, or incompatible dependencies.
In this guide, we’ll explore why this error happens and provide step-by-step solutions to fix it.
Why Does This Error Occur?
The error typically appears when:
Spring Boot dependencies are missing in
pom.xml
.Incorrect or missing Maven repository (Spring repositories not configured).
Maven project not properly loaded (IDE cache issue).
Incorrect Java or Spring Boot version (version mismatch).
Network/proxy issues (Maven unable to download dependencies).
Step-by-Step Fixes
1. Verify Spring Boot Dependencies in pom.xml
Ensure your pom.xml
includes the Spring Boot Starter Parent and required dependencies:
Basic Spring Boot Maven Setup
<project>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.0</version> <!-- Use latest stable version -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
</dependencies>
</project>
If Not Using spring-boot-starter-parent
If you’re not using the Spring Boot Parent POM, explicitly define Spring Boot dependencies:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.2.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
2. Check Maven Repositories
Maven needs access to Spring repositories to download Spring Boot dependencies. Ensure your pom.xml
includes:
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
3. Update Maven & Reload Project
Sometimes, the issue is due to IDE cache or Maven not syncing properly:
In IntelliJ IDEA
Right-click on
pom.xml
→ Maven → Reimport.File → Invalidate Caches → Restart IDE.
In Eclipse
Right-click project → Maven → Update Project.
Check "Force Update of Snapshots/Releases".
Command Line (if using terminal)
mvn clean install -U
(-U
forces Maven to update dependencies)
4. Check Java Version Compatibility
Spring Boot 3.x requires Java 17+, while 2.x works with Java 8+. Verify:
In pom.xml
<properties>
<java.version>17</java.version> <!-- For Spring Boot 3.x -->
</properties>
Check Installed Java Version
java -version
If using an older Java version, upgrade JDK or downgrade Spring Boot:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.18</version> <!-- For Java 8/11 -->
</parent>
5. Fix Network/Proxy Issues
If Maven cannot download dependencies due to corporate proxy/firewall, configure Maven settings:
Edit ~/.m2/settings.xml
<settings>
<proxies>
<proxy>
<id>corporate-proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.yourcompany.com</host>
<port>8080</port>
<username>your-username</username>
<password>your-password</password>
</proxy>
</proxies>
</settings>
Final Working Example
Here’s a complete pom.xml
that works with Spring Boot 3.2.0:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.0</version>
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>1.0.0</version>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
</project>
Conclusion
To fix "Package org.springframework.boot does not exist":
✅ Check
pom.xml
for correct Spring Boot dependencies.✅ Ensure Maven repositories are properly configured.
✅ Reload Maven project in IDE.
✅ Verify Java version compatibility.
✅ Check network/proxy settings if dependencies fail to download.
Following these steps should resolve the issue. If the problem persists, check Maven logs (mvn clean install -X
) for detailed errors.
Further Reading
Did this solution work for you? Let me know in the comments! 🚀
Subscribe to my newsletter
Read articles from FullStackJava directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

FullStackJava
FullStackJava
hey i am java backend developer and i have 3 years of experience working as java developer.