how to configure ext-mail

114 views
Skip to first unread message

ensienne

unread,
Apr 2, 2011, 10:29:25 AM4/2/11
to jenkins...@googlegroups.com
Hello,

I want to configure the use of ext-mail plugin.
I want to be able to send mail to developer where is the result of findbug,
codenarc, cobertura and sonar.
Is it possible?
I have googled for a long time and I found that the use of jelly script can
help.
I don't have any idea how can I do that.
Any idea, example can help.

thank you very much


--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3422211.html
Sent from the Jenkins users mailing list archive at Nabble.com.

farshid

unread,
Apr 2, 2011, 12:17:36 PM4/2/11
to jenkins...@googlegroups.com
yes.there is a way to run a custom jelly script to generate whatever content you want. its very flexible and you can choose to create the exact content.

e.g : you can access TestResults or cobrertura and etc.


all you need to do is to write your own jelly script and copy it under JENKINS_HOME\email-templates

and you can refer to it ${JELLY_SCRIPT,template="myscript"}.


ensienne

unread,
Apr 2, 2011, 12:42:47 PM4/2/11
to jenkins...@googlegroups.com
Thank you very much for answering me.
That what I have dove.
1. Copy the example given into a script analyse.jelly
2. place this example under templates examples folder of the plugin
ext-mail.
3. Create the job for cobertura analyse.
4. in the build post action of this job, I have coched Email-notification
and Editable-email-notification.
In Editable-notification, I have set tis parameters:
- Gllobal Recipient list: mi...@soci.com
-Content type: HTML
-Default subject: $DEFAULT_SUBJECT
-Default content:

Code Coverage Report
>
${JELLY_SCRIPT,template="analyse"}

That does not work:
the console output give this error:
ERROR: Could not send email as a part of the post-build publishers.
java.lang.NullPointerException
at java.util.regex.Matcher.quoteReplacement(Matcher.java:598)
at
hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:63)
at
hudson.plugins.emailext.ExtendedEmailPublisher.setSubject(ExtendedEmailPublisher.java:310)
at
hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:255)
at
hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:213)
at
hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:205)
at
hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:166)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at
hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:622)
at
hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:601)
at
hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:579)
at hudson.model.Build$RunnerImpl.cleanUp(Build.java:165)
at hudson.model.Run.run(Run.java:1405)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145)
Finished: FAILURE

In the jelly, there is many type of analyse, how can I specify that I want
cobertura.
I don't understand if the steps above are correct or not.

Thank you

--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3422390.html

Mirko Friedenhagen

unread,
Apr 2, 2011, 2:27:32 PM4/2/11
to jenkins...@googlegroups.com

ensienne

unread,
Apr 2, 2011, 3:10:29 PM4/2/11
to jenkins...@googlegroups.com
Thank you Marko.
It does not work for me. In the mail I have this:
JellyException: Could not parse Jelly script : null

What should I do?
Can you explain me the steps to follow.

Many thankx

--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3422594.html

ensienne

unread,
Apr 2, 2011, 3:54:47 PM4/2/11
to jenkins...@googlegroups.com
Now I have this error:

Email was triggered for: Failure
Sending email for trigger: Failure

Please any help

--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3422645.html

ensienne

unread,
Apr 2, 2011, 4:23:20 PM4/2/11
to jenkins...@googlegroups.com
I success to snd a mail but th content is only the console output.
My aim is to send report of dofferent analysis that I ahve like cobertura,
findbug, codenrcs...

--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3422699.html

ensienne

unread,
Apr 2, 2011, 4:40:11 PM4/2/11
to jenkins...@googlegroups.com
It does not work even the sending of mail
That is what I have done:

1. copy the example given by Marko (thank you).
2. place it under the templates dir
3. Create a cobertura job and in the "post buuild Actions", I have chosen
"Editable mail notifications"
in this section, in the DEFAUNT_CONTENT part, i put "${JELLY_SCRIPT,
template="html-with-health-and-console"} "

That is correct or not.

--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3422709.html

ensienne

unread,
Apr 3, 2011, 2:18:02 AM4/3/11
to jenkins...@googlegroups.com
My project is a grails project.
Perhaps there are some thing to add to display cobertura report


--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3423086.html

ensienne

unread,
Apr 4, 2011, 2:35:26 AM4/4/11
to jenkins...@googlegroups.com
I have a question, normally the templates should be placed ino
$HUDSON_HOME/plugins/email-ext/WEB-INF/classes/hudson/plugins/emailext/templates
or I should create a new folder $HUDSON_HOME/email-templates.

--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3424756.html

ensienne

unread,
Apr 4, 2011, 8:42:29 AM4/4/11
to jenkins...@googlegroups.com
If I execute a jelly script as a template, I have in this mail:
No tests ran.

JellyException: Could not parse Jelly script : null

How to resolve this problem

--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3425347.html

ensienne

unread,
Apr 7, 2011, 8:37:31 AM4/7/11
to jenkins...@googlegroups.com
Hello
The ext-mail does not send the mail as is indicated in the console output.

In the console I have this:


Email was triggered for: Failure
Sending email for trigger: Failure

Sending email to: us...@company.com
Finished: FAILURE

But I receive nothing.
any idea
thank you

--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3433243.html

Slide

unread,
Apr 7, 2011, 8:55:03 AM4/7/11
to jenkins...@googlegroups.com, ensienne
Did you try the test button in the global configuration and make sure
it sent you an email correctly?

--
slide-o-blog
http://slide-o-blog.blogspot.com/

ensienne

unread,
Apr 7, 2011, 9:03:51 AM4/7/11
to jenkins...@googlegroups.com
yes it works if I launch a test but if I launch a job and configure it to
send an ext-mail=> it does not

--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3433339.html

Slide

unread,
Apr 7, 2011, 9:24:03 AM4/7/11
to jenkins...@googlegroups.com
I have been using the email-ext plugin for months, so it must be
something in your configuration. Can you take a screenshot of both the
global config and project config for the email-ext?

--
slide-o-blog
http://slide-o-blog.blogspot.com/

ensienne

unread,
Apr 7, 2011, 9:35:28 AM4/7/11
to jenkins...@googlegroups.com

Slide

unread,
Apr 7, 2011, 9:58:28 AM4/7/11
to jenkins...@googlegroups.com, ensienne
This may sound odd, but try removing any spaces in the
${JELLY_SCRIPT,template="gmail_html"}, it looks like there is a space
(or more than one) around the comma.

--
slide-o-blog
http://slide-o-blog.blogspot.com/

ensienne

unread,
Apr 7, 2011, 11:44:48 AM4/7/11
to jenkins...@googlegroups.com
thanks but it does not resolve the problem.

--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3433801.html

Richard Bywater

unread,
Apr 7, 2011, 2:34:44 PM4/7/11
to jenkins...@googlegroups.com
Perhaps try with a basic text email?

Richard.

ensienne

unread,
Apr 8, 2011, 6:20:11 AM4/8/11
to jenkins...@googlegroups.com
even if I test a text il does not work

--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3435813.html

Richard Bywater

unread,
Apr 8, 2011, 11:10:39 PM4/8/11
to jenkins...@googlegroups.com
What do you mean by "does not work" - does it give you an exception, does it say sent email but one doesn't turn up? 

If the latter are you sure that a) the email address is correct, and b) the email isn't getting blocked somewhere along the way by the mail servers you use?

Richard.

ensienne

unread,
Apr 9, 2011, 2:52:13 AM4/9/11
to jenkins...@googlegroups.com
it say sent email but one doesn't turn up.
The adress mail is correct.

he email isn't getting blocked somewhere along the way by the mail servers
you use=> No

--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3438011.html

Manuel Doninger

unread,
Apr 9, 2011, 2:55:13 AM4/9/11
to jenkins...@googlegroups.com
Do you have access to the logs of the SMTP server you use?

Manuel

ensienne

unread,
Apr 9, 2011, 3:07:37 AM4/9/11
to jenkins...@googlegroups.com
I don't know. how can I check


--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3438026.html

ensienne

unread,
Apr 9, 2011, 2:04:03 PM4/9/11
to jenkins...@googlegroups.com
any idea how can we resolve this problem:

JellyException: Could not parse Jelly script : null

=> This the mail that I have received from hudson

--
View this message in context: http://jenkins.361315.n4.nabble.com/how-to-configure-ext-mail-tp3422211p3438768.html

Slide

unread,
Apr 9, 2011, 2:51:57 PM4/9/11
to jenkins...@googlegroups.com

That means your jelly script has an error in it, there is not currently an easy way to debug that I have found. You just need to simplify it and start adding stuff back in.

On Apr 9, 2011 11:04 AM, "ensienne" <t.ze...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages