Solve the problem that the configuration file application.properties in the SpringBoot project in IDEA cannot be turned into a green leaf state

##Solve the problem that the configuration file application.properties in the SpringBoot project in IDEA cannot be turned into a green leaf state##

Problem description : This problem has entangled me for a long time, for several days, I tried most of the methods mentioned on the Internet.
1. What is the introduction of spring in setting>>project sturcture>>>...I tried this method, but it didn't work.
2. Setting the type of text in setting>>>file type is still useless.

Let me talk about my own solution: After
I create a new module, I create a new startup class under the src>>main>>>java>>>com.example package . There are two packages that need to be imported: springapplication and springbootapplication. Just import the package.

Note :
##Whether it is bordered by green leaves depends on whether you create a startup class and whether you import the above two packages##

package com.atguigu.canal;

//导入这两个包后,就会变成绿叶
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class CanalApplication {
    
    

    public static void main(String[] args) {
    
    
        SpringApplication.run(CanalApplication.class, args);
    }
}

Insert picture description here


My guess is verified : after I create a new parent project, the configuration file is automatically generated as a small green leaf, because the startup class is created when the parent project is created at the beginning.
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44421869/article/details/106588825