zoukankan      html  css  js  c++  java
  • SpringBoot中application.yml无法使用@@读取pom.xml中标签值

    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文件下写入

    <build>   
    <!--重要 如果不设置resource 会导致application.yaml中的@@找不到pom文件中的配置-->    
        <resources>       
            <resource>            
                <directory>src/main/resources</directory>
                <filtering>true</filtering>        
            </resource>    
        </resources>
    </build>
  • 相关阅读:
    [solr]
    [solr]
    [Linux] CentOS 加入开机启动
    [Linux] VirtualBox
    [Eclipse]
    [JBoss]
    [solr]
    [solr]
    [solr]
    [solr]
  • 原文地址:https://www.cnblogs.com/justlove/p/13043391.html
Copyright © 2011-2022 走看看