springboot yml配置文件使用@[email protected] 启动报错Do not use @ for indentation

解决方法是:

在pom.xml的plugings内添加

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

然后在pom.xml的build内添加

<resources>
   <resource>
      <directory>src/main/resources</directory>
      <filtering>true</filtering>
   </resource>
</resources>

这样就可以在springboot的yml配置文件里引用maven暴露出去的数值了

.yml文件:

info.groupId: @[email protected]
info.artifactId: @[email protected]
info.version: @[email protected]

相关文章:

  • 2021-09-24
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2021-04-18
  • 2022-12-23
  • 2021-12-25
  • 2022-01-07
猜你喜欢
  • 2022-12-23
  • 2021-06-28
  • 2021-11-04
  • 2021-12-21
  • 2022-12-23
  • 2021-07-11
  • 2022-01-05
相关资源
相似解决方案