I have set up a spring boot project using the Spring Initializer, I tried several times to create a new project or play with the dependencies, everything seems to be in plac
From your pom.xml, try to remove spring repository entries, per default will download from maven repository. I have tried with 1.5.6.RELEASE and worked very well.
Delete the repository folder from "C:\Users\usename.m2" and create again or update maven project.
Try this, It might work for you too.
This worked for me on both v1.5 and v2.1
I have encountered the same problem while my first Spring boot application.
In tutorial i could see following dependency to start sample application
I have done the same, my Spring STS is recognizing all class but when i am annotating my main class with @SpringBootApplication it's not recognizing this class whereas i could see jar was available in the class path.
I have following to resolve issues
After that it worked.
Thanks
When you run your application as an jar, your Manifest.MF
file should know which class has the main method.
To add this information when SpringBoot compiles your code, add start-class
property on your pom file.
E.g.:
<properties>
<start-class>com.example.DemoApplication</start-class>
</properties>
In my project, updated the dependency on spring-boot-starter-parent from 2.0.0.release to 2.0.5.relese. Doing this resolved the issue The import org.springframework.boot.SpringApplication cannot be resolved