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.
Your help will be appriciated. Thanks
@SpringBootApplication is a alternative for @Configuration , @EnableAutoConfiguration and @ComponentScan . Probably you want use @Configuration + @ComponentScan . If you want load xml configuration you can use: @ImportResource annotation.
Spring Boot @SpringBootApplication annotation is used to mark a configuration class that declares one or more @Bean methods and also triggers auto-configuration and component scanning. It's same as declaring a class with @Configuration, @EnableAutoConfiguration and @ComponentScan annotations.
So yes, this is expected behavior given your project setup. Put each @SpringBootApplication class in a separate subpackage if you don't want this to happen for local testing.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With