@SpringBootApplication cannot be resolved to a type In STS

Abdul picture Abdul · Jan 16, 2017 · Viewed 43.5k times · Source

I am very new to STS. I searched for this error in stackoverflow. I didn't find correct matching answer.

I am able to see the class in MavenDependencies seciton in STS but not able to add the annotation in my java class.

enter image description here Your help will be appriciated. Thanks

enter image description here

Answer

Foolish picture Foolish · Jun 12, 2017

Go to your maven repository directory For windows on below path C:\Users\YourUser\.m2\repository\org\springframework\boot Then delete spring-boot-autoconfigure folder.

Now go to eclipse Right click on project -> Maven -> Update Project.

This solved the problem for me.