springboot项目中application.properties无法变成小树叶问题解决方案
作者:爱吃biangbiang面
这篇文章主要介绍了springboot项目中application.properties无法变成小树叶问题解决,本文通过图文实例代码相结合给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
1.检查我们的resources目录的状态,看看是不是处在普通文件夹的状态,如果是的话,我们需要重新mark一下

右键点击文件夹,选择mark directory as → resources root

此时我们发现配置文件变成了小树叶

2.如果执行了上述方法还是不行的话,可以尝试重新指定配置文件,如下图所示的步骤

3.如果用了所有的方法都不行的话,可能与我们pom文件的配置有关系,大概率是<build></build>配置中有一些错误,可以尝试选择性删除,一步步尝试是哪一部分的错误,观察配置文件是否能恢复到小树叶的状态
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.4.2.RELEASE</version>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<!--源文件位置-->
<directory>src/main/webapp</directory>
<!--指定编译到META-INF/resources,该目录定死的不要随便写-->
<targetPath>META-INF/resources</targetPath>
<!--指定要把哪些文件编译进去,**表示webapp目录及子目录,*.*表示所有文件-->
<includes>
<include>**/*.*</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>到此这篇关于springboot项目中application.properties无法变成小树叶问题解决的文章就介绍到这了,更多相关springboot application.properties无法变成小树叶内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
