使用 jenkins 执行 CI 任务,但无法发送邮件。
这是我的配置:系统配置如下:
这是项目邮件配置:
这是输出日志:
Started by user [8mha:////4Nis2K36By9QP5h851e9fPgjtTKHdnnqmcoxBqCGg2BlAAAAmB+LCAAAAAAAAP9b85aBtbiIQTGjNKU4P08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/JJUBAhiZGBgqihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAzOEgYe/dLi1CL9xLyUotRyAOMeJ3/BAAAA[0mAndrewJia
Building in workspace C:\Program Files (x86)\Jenkins\workspace\EmailTest
Checking for pre-build
Executing pre-build step
Checking if email needs to be generated
No emails were triggered.
Checking for post-build
Performing post-build step
Checking if email needs to be generated
Email was triggered for: Success
Sending email for trigger: Success
messageContentType = text/plain; charset=UTF-8
Adding recipients from project recipient list
Adding recipients from trigger recipient list
Successfully created MimeMessage
Executing pre-send script
Pre-send script tried to access secured objects: classpath entry file:/C:/ajia/email-templates/ (4a3bae0a9b9ef3e2342a359514daeccb337beaeb) not yet approved for use
ERROR: Could not send email as a part of the post-build publishers.
[8mha:////4CDZUKtxqe4Q69lSu7kc7sXTiWcyvwoa7rJoTRZBvJkKAAAAVx+LCAAAAAAAAP9b85aBtbiIQSmjNKU4P08vOT+vOD8nVc8DzHWtSE4tKMnMz/PLL0mV3NWzufebKBsTA0NFEYMUmgZnCA1SyAABjCCFBQC2xNaiYAAAAA==[0morg.jenkinsci.plugins.scriptsecurity.scripts.UnapprovedClasspathException: classpath entry file:/C:/ajia/email-templates/ (4a3bae0a9b9ef3e2342a359514daeccb337beaeb) not yet approved for use
at org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval.using(ScriptApproval.java:577)
at hudson.plugins.emailext.ExtendedEmailPublisher.expandClasspath(ExtendedEmailPublisher.java:671)
at hudson.plugins.emailext.ExtendedEmailPublisher.executeScript(ExtendedEmailPublisher.java:613)
at hudson.plugins.emailext.ExtendedEmailPublisher.executePresendScript(ExtendedEmailPublisher.java:566)
at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:450)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:435)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:343)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.model.Build$BuildExecution.cleanUp(Build.java:196)
at hudson.model.Run.execute(Run.java:1775)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:405)
Some error occured trying to send the email...check the Jenkins log
Finished: SUCCESS
检查此机器上的服务,以及该用户对 jenkins 服务的权限。没有发现奇怪的东西。
我现在不知道这有什么问题。有人可以知道这种情况并告诉我解决方案吗?
谢谢。