线我在JIRA下面的Velocity模板时词法错误(注,多余的线条保持):速度注释掉在文件末尾
NOTE: Please REPLY-TO this email when replying to this issue.
##parse("templates/email/includes/issueplugins.vm")
#if($comment.getId())[ ${baseurl}/browse/${issue.getKey()} ] #end ##?page=${tabpanel-comment}&focusedCommentId=${comment.getId()}#action_${comment.getId()} ] #end
#if($remoteUser.fullName)
$i18n.getText("template.issue.commented.on", $remoteUser.fullName, $issue.getKey())
#dashes($!remoteUser.fullName)--------------#dashes($issue.getKey())-
#end
#if($changelog)
#changes([])
#end
#comment()
#visibility()
#parse("templates/email/text/includes/issuesummary.vm")
#parse("templates/email/text/includes/footer.vm")
有下列最后一行没有行。我什么时候该上最后一行:
##parse("templates/email/text/includes/footer.vm")
我收到以下错误:
An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug.
Details:
-------
org.apache.velocity.exception.ParseErrorException: Lexical error:
org.apache.velocity.runtime.parser.TokenMgrError:
Lexical error at line 20, column 51. Encountered: <EOF> after : ""
at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:272)
at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:202)
...
我发现从2004年的以下问题:
https://issues.apache.org/jira/browse/VELOCITY-272
这似乎建议这是一个固定在1.5的错误。在我的JIRA系统信息检查,我看到JIRA 4.2.1似乎暗示1.6版是在使用中:
Atlassian Template Renderer Velocity 1.6 Plugin - 1.1.1
当我移动开始#if($comment.getId())
到底的路线,错误消失。我在模板末尾做错了什么,或者这是一个错误?
编辑
嗯。当我这样做:
#if($comment.getId())[ ${baseurl}/browse/${issue.getKey()} ] #end ##?page=${tabpanel-comment}&focusedCommentId=${comment.getId()}#action_${comment.getId()} ] #end
作为最后一行,后面没有空行,我得到了同样的错误。但是,如果我在该行之后添加一行(仅打ENTER
一次),它就可以工作。
Do Velocity模板需要结束空间吗?我很困惑。
您需要查看实际使用哪个Velocity渲染模板;默认JIRA的速度为1.4。 –
你如何解释这一点? –
不确定;我对这个插件一无所知,所以我不知道它应该做什么,或者它如何与JIRA的其他部分进行交互。 –