Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven postman插件:目标、surefire邮件的正确配置_Maven_Maven Surefire Plugin_Maven Failsafe Plugin - Fatal编程技术网

Maven postman插件:目标、surefire邮件的正确配置

Maven postman插件:目标、surefire邮件的正确配置,maven,maven-surefire-plugin,maven-failsafe-plugin,Maven,Maven Surefire Plugin,Maven Failsafe Plugin,让这个插件将故障保护或surefire测试结果发送给我,我真是太高兴了。发送邮件目标工作正常,但无法使用groovy执行条件发送。我可以向我的邮件收件人发送附件 但是,当我运行surefire邮件目标时,我只发送/接收一封没有测试结果内容的电子邮件。我收到一封默认内容为:build for com.xxxx.yyy:zzz abc:1.1.0-SNAPSHOT executed的电子邮件。我从未见过这个目标的默认测试结果示例。我假设它类似于surefire文件夹中的emailable-repor

让这个插件将故障保护或surefire测试结果发送给我,我真是太高兴了。发送邮件目标工作正常,但无法使用groovy执行条件发送。我可以向我的邮件收件人发送附件

但是,当我运行surefire邮件目标时,我只发送/接收一封没有测试结果内容的电子邮件。我收到一封默认内容为:build for com.xxxx.yyy:zzz abc:1.1.0-SNAPSHOT executed的电子邮件。我从未见过这个目标的默认测试结果示例。我假设它类似于surefire文件夹中的emailable-report.html,但不确定

发送结果 地点 万无一失的邮件 [TeamCity]项目A-测试结果 ${project.build.directory}/site/failsafe-report.html ${project.build.directory}/failsafe报告 第一last@company.com 我尝试了使用和不使用surefireReportHtml和testReportsDirectory标记。我正在运行这个:mvn部署站点

这是我的日志:

[13:09:39][com.company.project:project-model] [INFO] analyze: surefire reports...
[13:09:39][com.company.project:project-model] [DEBUG] -->F:\work\ff5c2f34c9fedec2\project-model\target\failsafe-reports\TEST-TestSuite‌​.xml 
[13:09:40][com.company.project:project-model] [DEBUG] found TestSuite: errors=0, skipped=0, failures=0, tests=6
[13:09:40][com.company.project:project-model] [DEBUG] test ERRORS: 0 
[13:09:40][com.company.project:project-model] [DEBUG] test SKIPPED: test FAILURES: 0 test TOTAL: 6 ] evaluating groovy condition [errors <= 0 || errors > 0]

我使用了一个变体来生成一封包含报告数据的电子邮件。我放弃了surefire邮件目标,使用了发送邮件目标,只是附加了failsafe生成的emailable-report.html

希望这有帮助

     <plugin>
            <groupId>ch.fortysix</groupId>
            <artifactId>maven-postman-plugin</artifactId>
            <configuration>
                <failonerror>false</failonerror>
                <skip>${test.integration.notif.skip}</skip>
                <mailhost><your mail host subdomain></mailhost>
                <from><your email account id and mail server: eg: id@comcast.net></from>
                <receivers>
                    <receiver><email account id and mail server></receiver>
                </receivers>
            </configuration>
            <executions>
                <execution>
                    <id>send attached failsafe html results notification</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>send-mail</goal>
                    </goals>
                    <configuration>
                        <subject>[TeamCity] Integration Test Results</subject>
                        <htmlMessage>
                           <![CDATA[
                             <p>
                                 We have new integration test results for:
                                    build: ${project.groupId}:${project.artifactId}:${project.version}
                                    rev: ${build.vcs.number}

                                 See attached failsafe report.
                             </p>
                             <br>
                           ]]>
                        </htmlMessage>
                        <fileSets>
                            <fileSet>
                                <directory>${project.build.directory}/failsafe-reports</directory>
                                <includes>
                                    <include>**/emailable-report.html</include>
                                </includes>
                            </fileSet>
                        </fileSets>
                    </configuration>
                </execution>
            </executions>
        </plugin>

这是mvn日志:[13:09:39][com.company.project:project model][INFO]analyze:surefire报告。。。[13:09:39][com.company.project:project model][DEBUG]->F:\work\ff5c2f34c9fedec2\project model\target\failsafe reports\TEST-TestSuite.xml[13:09:40][com.company.project:project model][DEBUG]发现TestSuite:errors=0,skiped=0,failures=0,tests=6[13:09:40][com.company project:project-TEST model][DEBUG]测试错误:0[13:09:40][com.company.project:project model][DEBUG]已跳过测试:测试失败:0测试总数:6]正在评估groovy条件[错误0]