问题
I'm trying to configure some features in Jenkins for our project. In the process of configuring Editable Email Notification, I have created a new jelly script file in $JENKINS_HOME/email-templates folder as shown here
and accessing it in Jenkins config like this
When I build the job, with these setting, I'm getting email with the content "JellyException: Could not parse Jelly script : null"
Thanks in advance!!
回答1:
I faced a similar issue after I updated my Jenkins installation. I used the "Email Template Testing" feature to verify my script, but kept getting
JellyException: Could not parse Jelly script : null
In my case the issue was caused because of the use of jelly:util library in my jelly script. The script used u:loadText and u:file tags.
It seems that newer version of Jenkins do not include the jelly:util library, required for using the util tags. I resolved the issue by manually placing the commons-jelly-tags-util-1.1.1.jar file in the \war\WEB-INF\lib directory of Jenkins and restarting it.
回答2:
There are two issues that are usually encountered when working with email templates (and there is another issue#2.5 will i'll explain as well :) )
- I faced this issue when I copied/created new scripts from a different user rather than the one that Jenkins uses to run as. So in this case if 'ubuntu' is not the user that runs Jenkins as well, consider chowning the file and group to the user/group of jenkins user.
- There were times when my jelly actually had an error which could not let it be parsed. I came to know about it from using the 'Email Template Testing' option available in the job options, which resulted in the same error
Now for the 2.5 issue
2.5. Please be cognizant of the fact that jelly templates have a different placeholder than the template-email-templates.
The '.template' files are loaded using ${SCRIPT}
and '.jelly' Jelly scripts are loaded using ${JELLY_SCRIPT}
tags, if you use JELLY_SCRIPT tag to load a template, you might end up with the same error as well.
This point is naive but it's worth listing it here so that anyone with this issue has all the checkpoints required to fix this issue.
来源:https://stackoverflow.com/questions/30130860/im-getting-jellyexception-could-not-parse-jelly-script-null