如何安装具有包含字符串插值的Kotlin代码的maven原型?

如何安装具有包含字符串插值的Kotlin代码的maven原型?,maven,kotlin,jvm,velocity,maven-archetype,Maven,Kotlin,Jvm,Velocity,Maven Archetype,我正在尝试安装我从Kotlin项目创建的maven原型。每当我尝试安装原型时,都会出现以下错误: Archetype IT 'basic' failed: org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: Encountered "()}\"\n 触发错误的代码行是 return "redirect:${getRequestMapping()}"

我正在尝试安装我从Kotlin项目创建的maven原型。每当我尝试安装原型时,都会出现以下错误:

Archetype IT 'basic' failed: org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: Encountered "()}\"\n 
触发错误的代码行是

return "redirect:${getRequestMapping()}"
我能做些什么来解决这个问题吗?
我经常使用字符串插值,我不想用串联字符串替换它们

美元符号“$”对ApacheVelocity有意义,ApacheVelocity是原型使用的引擎。Velocity看到了“$”,认为它应该对它做些什么,但是语法错误(对于Velocity),它失败了

这里的修复方法是避开美元符号,以便Velocity忽略它,如中所述

类似这样的东西,显示美元符号,但也有其他可能需要转义的东西,具体取决于用例:

## File will be filtered by Velocity - it is a Velocity template.
## Establish escape sequences for Velocity special chars.
#set( $symbol_pound = '#' )    
#set( $symbol_dollar = '$' )   
#set( $symbol_escape = '\' )

## Use the variable anywhere the interpolation is used
return "redirect:${symbol_dollar}{getRequestMapping()}"

Velocity文档仅使用“D”作为变量名来显示相同的技术。我喜欢搜索性和自我文档的较长名称。

美元符号“$”对ApacheVelocity有意义,ApacheVelocity是原型使用的引擎。Velocity看到了“$”,认为它应该对它做些什么,但是语法错误(对于Velocity),它失败了

这里的修复方法是避开美元符号,以便Velocity忽略它,如中所述

类似这样的东西,显示美元符号,但也有其他可能需要转义的东西,具体取决于用例:

## File will be filtered by Velocity - it is a Velocity template.
## Establish escape sequences for Velocity special chars.
#set( $symbol_pound = '#' )    
#set( $symbol_dollar = '$' )   
#set( $symbol_escape = '\' )

## Use the variable anywhere the interpolation is used
return "redirect:${symbol_dollar}{getRequestMapping()}"
Velocity文档仅使用“D”作为变量名来显示相同的技术。我喜欢搜索能力和自我文档的较长名称