idea spring boot项目扫描不到.yml配置文件

错误

java.lang.IllegalStateException: Failed to load property source from location ‘classpath:/application.yml’
Caused by: org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input length = 1

解决方法

在pom.xml文件中添加代码
位置:中
添加部分:

<resources>
			
			<resource>
				<directory>src/main/javadirectory>
				<includes>
					<include>**/*.propertiesinclude>
					<include>**/*.xmlinclude>
				includes>
				<filtering>falsefiltering>
			resource>
			<resource>
				<directory>${basedir}/src/main/resourcesdirectory>
				<includes>
					
					
					<include>*.ymlinclude>
					<include>*.propertiesinclude>
					<include>*.xmlinclude>
					<include>enc_priinclude>
				includes>
			resource>
			
		resources>

你可能感兴趣的:(idea spring boot项目扫描不到.yml配置文件)