idea创建SpringBoot项目不识别application
2020-06-07 本文已影响0人
周山
idea创建SpringBoot项目不识别application.properties内容以及报错提示
this inspection reports all properties not referenced from outside of the properties file
这个是由于资源文件路径设置错误所致,我们使用crtl+shift+alt+s打开图示目录
![](https://img.haomeiwen.com/i14535918/6e8ef0c073075956.png)
针对application所在文件夹,比如src\main\resources\config下新建了.properties文件,我们需要去按上图步骤设置增加该路径。
![](https://img.haomeiwen.com/i14535918/579dcbda98c7e7b0.png)
Detects package statements that do not correspond to the project directory structure and reports classes without package statements.
这个是由于包名路径设置错误引起的,正确设置source directory
![](https://img.haomeiwen.com/i14535918/cc0a8e36922c7417.png)
比如我们类的路径是java/com/example/demo.java这样的;
对于demo.java而言,包名是:com.example则,
我们就要把java右键设置为Sources。
![](https://img.haomeiwen.com/i14535918/eb91aa21f7c93e05.png)
这样以上问题就会解决。