application.yaml文件读取不到pom.xml下的标签值,报
Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
found character '@' that cannot start any token. (Do not use @ for indentation)
in 'reader', line 7, column 13:
active: @spring.profiles.active@
的解决方法 :
在模块的pom.xml文件下写入
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17<build> <!--重要 如果不设置resource 会导致application.yaml中的@@找不到pom文件中的配置--> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> <!--重要 如果不设置resource 会导致application.yaml中的@@找不到pom文件中的配置--> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
最后
以上就是贤惠书本最近收集整理的关于SpringBoot中application.yaml无法使用@@读取pom.xml中标签值的一个解决方法的全部内容,更多相关SpringBoot中application.yaml无法使用@@读取pom.xml中标签值内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复