I imported the spring-boot-1.1.10.RELEASE.jar into my j2ee project. But i can not found the class of autoconfigure. Here is code:
import org.springframework.boot.autoconfigure;
import org.springframework.boot.SpringApplication;
import org.springframework.context.annotation.ComponentScan;
@ComponentScan
@EnableAutoConfiguration
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
The Compile error:
The import org.springframework.boot.autoconfigure cannot be resolved
I had the same problem and I tried above solutions. But I have found a different issue.
In latest springframework, this org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder
has been moved to
org.springframework.boot.jdbc.DataSourceBuilder
. so you have to edit in import
And then you will notice that you have to use DataSourceBuilder.create(classLoader)
instead of new DataSourceBuilder(classLoader)
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