我做了什么以便在邮件中包含有关失败的有用信息:
try { stage 'checkout cvs' node('master') { } stage 'compile' node('master') { } stage 'test unit' node('master') { } stage 'package' node('master') { } stage 'nexus publish' node('master') { } stage 'Deploy to App Server' node('master') { }} catch(e) { String error = "${e}"; // Make the string with job info, example: // ${env.JOB_NAME} // ${env.BUILD_NUMBER} // ${env.BUILD_URL} // and other variables in the pre mail bcc: '', cc: '', charset: 'UTF-8', from: '', mimeType: 'text/html', replyTo: '', subject: "ERROR CI: Project name -> ${env.JOB_NAME}", to: "${mails_to_notify}", body: "<b>${pivote}</b><br>nnMensaje de error: ${error}nn<br>Projecto: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br> URL de build: ${env.BUILD_URL}"; error "${error}"}


