application使用@符合问题:'@' that cannot start any token. (Do not use @ for indentation)

在application配置文件中使用@出现异常:

Exception in thread "main" while scanning for the next token
found character '@' that cannot start any token. (Do not use @ for indentation)
 in 'reader', line 4, column 11:
        name: @project.artifactId@

代码:

info:
  app:
    name: @project.artifactId@
    encoding: @project.build.sourceEncoding@
    java:
      source: @java.version@
      target: @java.version@

解决方案,用单引号或双引号将@@之间的内容包起来:

info:
  app:
    name: "@project.artifactId@"
    encoding: '@project.build.sourceEncoding@'
    java:
      source: '@java.version@'
      target: '@java.version@'

现在给出springcloud官方的github中找到的问题解决方案,仅供参考
application使用@符合问题:'@' that cannot start any token. (Do not use @ for indentation)_第1张图片

连接github .

今天向周立大神请教,得到的答案如下:

周立
构建后就不会报错了
周立 2018/7/22 18:23:36
mvn clean install 后 打包是可以运行的 
所以代码本身并没有问题。

我本地现在没有再出现这个问题,其它遇到这个问题的朋友可以试下。

但是这个好像不是真正的解决方案,如果了解的请给出。

你可能感兴趣的:(其它,使用异常,character,符号问题,indentatio,reader)