我正在 jenkins 上运行自动化构建,使用 ext 电子邮件插件发送带有附件的自动电子邮件。我能够从文件夹中提取所需的附件,但需要排除一个特定文件。我怎样才能做到这一点? 我需要排除“index.html”文件,但获取文件夹中的其他 html 文件
我目前正在获取发送的电子邮件中的所有 html 文件,不排除“index.html”文件
我尝试过以下方法 -
<fileset dir="**/target/surefire-reports" casesensitive="yes">
<include name="/*.html"/>
<exclude name="/index.html"/> </fileset>
<delete file="**/target/surefire-reports/index.html"/>,
**/target/surefire-reports/*.html
最佳答案
Jenkins Ext Email Plugin 似乎不支持排除语法,只支持包含。
来自帮助:
The format is a comma separated list of Ant include file syntax.
因此,您需要尝试找到最合适的包括模式(或列出所有需要的文件)。例如,如果所有文件的名称中至少有 6 个符号,请尝试类似
**/target/surefire-reports/??????*.html
关于java - 排除来自 Jenkins 的自动电子邮件的电子邮件附件中的特定文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54195732/