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.
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.