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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.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 如何在jenkins中配置testng testsuite_Maven_Jenkins_Testng - Fatal编程技术网

Maven 如何在jenkins中配置testng testsuite

Maven 如何在jenkins中配置testng testsuite,maven,jenkins,testng,Maven,Jenkins,Testng,我正在使用Mavenproject,我有不同的TestNGsuite文件。现在我必须配置Jenkins和POM.xml文件,在那里我必须从Jenkins调用我的单独测试套件。请帮助我了解如何配置我的项目 我已将pom.xml文件配置如下 <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-

我正在使用
Maven
project,我有不同的
TestNG
suite文件。现在我必须配置
Jenkins
和POM.xml文件,在那里我必须从
Jenkins
调用我的单独测试套件。请帮助我了解如何配置我的项目


我已将pom.xml文件配置如下

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.8.1</version>
        <configuration>
            <includes>
                <include>**/*.*</include>
            </includes>
            <suiteXmlFiles>
                <suiteXmlFile>${project.basedir}/src/test/java/com/cisco/citeis/suites/${x‌​mlfile}</suiteXmlFile>
            </suiteXmlFiles>
        </configuration>
    </plugin>
</plugins>

org.apache.maven.plugins
maven surefire插件
2.8.1
**/*.*
${project.basedir}/src/test/java/com/cisco/citeis/suites/${x‌​mlfile}
在Jenkins中,我在POM文件add中添加命令
clean test-Dsuite=AppFlow.xml

<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <suiteFile></suiteFile>
</properties>

        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.1</version>
            <configuration>
                <suiteXmlFiles>
                    <suiteXmlFile>${suiteFile}</suiteXmlFile>
                </suiteXmlFiles>
            </configuration>
        </plugin>

UTF-8
maven surefire插件
2.22.1
${suiteFile}
在jenkins中添加以下命令


clean test-DsuiteFile=\AppFlow.xml

三件事:1
testng.xml
2<代码>TestRunner以及所有这些之前的3<代码>向我们展示您所做的。我已将pom.xml文件配置为org.apache.maven.plugins maven surefire plugin 2.8.1**/*.${project.basedir}/src/test/java/com/cisco/citeis/suites/${xmlfile}我不知道如何调用参数inJenkinsin Jenkins I add命令clean test-Dsuite=AppFlow.xml如果将变量标记为${xmlfile},那么应该传递-Dxmlfile而不是-Dsuite。休息吧,一切都好。