美文网首页
jenkins构建:通过testng.xml构建项目

jenkins构建:通过testng.xml构建项目

作者: 仰望星空_4645 | 来源:发表于2019-07-14 20:13 被阅读0次

1、项目的pom.xml中build下添加maven插件,xmlFileName为可变参数

<plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-surefire-plugin</artifactId>
               <version>2.15</version>
               <configuration>
                   <forkMode>never</forkMode>
                   <argLine>-Dfile.encoding=UTF-8</argLine>
                   <suiteXmlFiles>
                       <!--suppress UnresolvedMavenProperty -->
                       <suiteXmlFile>${xmlFileName}</suiteXmlFile>
                   </suiteXmlFiles>
               </configuration>
           </plugin>

2、jenkins新建maven项目


image.png

构建脚本:


image.png
image.png

相关文章

网友评论

      本文标题:jenkins构建:通过testng.xml构建项目

      本文链接:https://www.haomeiwen.com/subject/homikctx.html