我正在使用giter8为Scala服务创建模板。我想在模板中使用的字段是description
。然而,这似乎是reserved as a Maven property。知道如何解决这个问题吗?
这些是我当前(工作)的属性:
description = Please answer the following questions:\n
id =
package = com.sebi.$id$
运行模板,我得到:
13:55 $ g8 file://blaze-service-template.g8/
Please answer the following questions:
id []: test
package [com.sebi.test]:
Template applied in ./.
这就是我想要实现的目标:
description = Please answer the following questions:\n
id =
package = com.sebi.$id$
description = Please describe $id$
运行模板,我得到:
13:56 $ g8 file://blaze-service-template.g8/
context [anonymous] 1:17 attribute id isn't defined
Please describe
context [anonymous] 1:17 attribute id isn't defined
Please describe
id []: test
package [com.sebi.test]:
Template applied in ./.
不知何故,使用description
作为自定义字段会破坏giter8。
如果我使用_description
作为自定义字段,则有效:
14:00 $ g8 file://blaze-service-template.g8/
Please answer the following questions:
id []: test
package [com.sebi.test]:
_description [Please describe test]: A stackoverflow Minimal, Complete, and Verifiable example
Template applied in ./.
如果我使用_description
作为必填字段,我会收到:
14:05 $ g8 file://blaze-service-template.g8/
context [anonymous] 1:17 attribute id isn't defined
Please describe
_description [Please answer the following questions:
]: