I would like to reuse a template inside multiple other template and I looked in Apache Velocity Template and I found what I am looking for
## Load the file one.vm into this template #include( "one.vm" )
However when I tried it in Jira it didn't work. Most probable because of the path
So I tried to change the path to the vm by trying all of the below
#include("./src/main/resources/templates/one.vm")
#include("src/main/resources/templates/one.vm")
#include("./one.vm")
#include("templates/one.vm")
but I keep getting an exception. Does anyone know how to achieve this in Jira?
Exception
Exception getting message body from Velocity: org.apache.velocity.exception.VelocityException: Cannot process content resource
[INFO] [talledLocalContainer] org.apache.velocity.exception.VelocityException: Cannot process content resource
[INFO] [talledLocalContainer] at org.apache.velocity.runtime.resource.ContentResource.process(ContentResource.java:89)
[INFO] [talledLocalContainer] at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:446)
[INFO] [talledLocalContainer] at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:354)
[INFO] [talledLocalContainer] at org.apache.velocity.runtime.RuntimeInstance.getContent(RuntimeInstance.java:1444)
[INFO] [talledLocalContainer] at org.apache.velocity.runtime.directive.Include.renderOutput(Include.java:229)
[INFO] [talledLocalContainer] at org.apache.velocity.runtime.directive.Include.render(Include.java:155)
[INFO] [talledLocalContainer] at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
[INFO] [talledLocalContainer] at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
[INFO] [talledLocalContainer] at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
[INFO] [talledLocalContainer] at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
[INFO] [talledLocalContainer] at org.apache.velocity.Template.merge(Template.java:328)
[INFO] [talledLocalContainer] at org.apache.velocity.Template.merge(Template.java:235)
[INFO] [talledLocalContainer] at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:381)
Hi
Have you tried?
#parse("/templates/one.vm")
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.