@SpringBootApplication cannot be resolved to a type In STS

Run bellow commands from command line

mvn clean dependency:tree
mvn clean compile

select project and do a maven->update This solved my problem


Just change your spring boot version into 1.5.6 from 1.5.8. trust me i have tried every other solution but only this solution worked for me.


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.