Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to run clean compile but I am facing following error package org.springframework.boot does not exist in Java. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How This Error Occurs ?
I am trying to run clean compile but I am facing following error.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project SpringBootPoc: Compilation failure: Compilation failure:
[ERROR] package org.springframework.boot does not exist
[ERROR] package org.springframework.boot.autoconfigure does not exist
[ERROR] cannot find symbol
[ERROR] symbol: class SpringBootApplication
[ERROR] cannot find symbol
[ERROR] symbol: variable SpringApplication
[ERROR] location: class com.benayed.spboot.poc.SpringBootPoc.SpringBootPocApplication [ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project SpringBootPoc: Compilation failure
How To Solve package org.springframework.boot does not exist Error ?
- How To Solve package org.springframework.boot does not exist Error ?
To Solve package org.springframework.boot does not exist Error You just need to check your Pom.xml and make sure your spring-boot-starter-data-jpa line is uncommented. You must have pring-boot-starter-data-jpa uncommented in your pom.xml file. If you dont have then just add it. Now your error must be solved.
- package org.springframework.boot does not exist
To Solve package org.springframework.boot does not exist Error You just need to check your Pom.xml and make sure your spring-boot-starter-data-jpa line is uncommented. You must have pring-boot-starter-data-jpa uncommented in your pom.xml file. If you dont have then just add it. Now your error must be solved.
Solution 1: add dependency
You just need to add this dependency. Just like this.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
and my error was solved.
Solution 2: check your Pom.xml
You just need to check your Pom.xml and make sure your spring-boot-starter-data-jpa line is uncommented. You must have pring-boot-starter-data-jpa uncommented in your pom.xml file. If you dont have then just add it.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
Now your error must be solved.
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read