springboot 配置多環境使用yml配置 @profileActive@ 啓動報錯Do not use @ for indentation

yml配置文件中添加了下面配置

spring:
  profiles:
    active: @profileActive@

啓動會報錯:@profileActive@ 啓動報錯Do not use @ for indentation

解決辦法:

需要在pom文件中添加以下代碼

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <configuration>
        <delimiters>@</delimiters>
        <useDefaultDelimiters>false</useDefaultDelimiters>
    </configuration>
</plugin>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章