yml使用@符合問題:'@' that cannot start any token. (Do not use @ for indentation)

轉至 https://www.cnblogs.com/liaojie970/p/9007896.html#undefinedhtml

在application配置文件中使用@出現異常:java

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@

代碼:app

複製代碼
info: app: name: @project.artifactId@ encoding: @project.build.sourceEncoding@ java: source: @java.version@ target: @java.version@
複製代碼

解決方案,用單引號或雙引號將@@之間的內容包起來:ui

複製代碼
info: app: name: "@project.artifactId@" encoding: '@project.build.sourceEncoding@' java: source: '@java.version@' target: '@java.version@'
複製代碼
相關文章
相關標籤/搜索