An error occurred in the boot package after springboot imported the custom launcher dependency: Cannot resolve symbol...

Solution

1. Delete the application.properties file in the resources directory of the custom automatic configuration module

2. Create a META-INF/spring.factories file under the resources directory, and configure the fully qualified path of the automatic configuration class

org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
// 这是我自定义的自动配置类
com.atguigu.starter.HelloServiceAutoConfiguration

3. Delete the startup class automatically created by springboot.
This is basically enough. If it still doesn't work, continue to try the following steps.
Note that if you have installed both the custom starter and the automatic configuration class in the maven warehouse, then first go to the warehouse to delete the old jar, and then re-maven install
4. Only keep the spring-boot-starter dependency, other dependencies As well as plugin and build can be deleted

 <!-- 启动器-->
    <dependencies>
        <!-- 引入自动配置模块-->
        <dependency>
            <groupId>com.atguigu.starter</groupId>
            <artifactId>atguigu-spring-boot-starter-autoconfigurer</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
    </dependencies>

5. Delete the test folder

Conclusion

Guiqiu to understand the specific solutions and principles of the big guy taught me this little white, woo woo woo~~

Guess you like

Origin blog.csdn.net/qq_47768542/article/details/111120091