2011-10-08 75 views
-2

线我在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模板需要结束空间吗?我很困惑。

+0

您需要查看实际使用哪个Velocity渲染模板;默认JIRA的速度为1.4。 –

+0

你如何解释这一点? –

+0

不确定;我对这个插件一无所知,所以我不知道它应该做什么,或者它如何与JIRA的其他部分进行交互。 –

回答

1
~/tech/atlassian/atlassian-jira-4.4.1-standalone $ find . -name "*velocity*.jar" 
./atlassian-jira/WEB-INF/lib/velocity-1.4-atlassian-9.jar 
./atlassian-jira/WEB-INF/lib/velocity-tools-1.3.jar 
./atlassian-jira/WEB-INF/lib/atlassian-velocity-0.8.jar 

不,他们没有;请参阅this discussion from a few days ago ..

+0

是的,当然。我喜欢很多Atlassian产品,但有时候......谢谢! ':'' –

+0

@JaredFarrish你也可以问他们,如果它是一个Atlassian插件 - 我做了一个快速搜索,但没有跑过它;如果我有一段时间,我会捅一下。 (我不明白古代的速度 - 一些最好的产品,但是:是的:/ –

+0

当我创建问题时,我认为这是一个速度问题;看着JIRA插件,似乎表明它们是在更新的版本(1.6)上,我环顾四周,但没有想到像你那样搜索,这就是我编辑的结果,我实际上是在第二天左右删除这个问题,所以我很高兴你注意到它,Atlassian在他们的开发重点中做出了很多“棘手的”决定(至少对我们来说是plebes) –