我试图使用jenkins运行我的testNg.xml文件。但发生了以下错误。
Jenkins设置
JDK安装已设置为自动安装
Maven配置设置为,
文件系统中的默认设置提供商=设置文件
文件路径= C:\ Users ***。m2 \ settings.xml
默认全局设置提供商=使用默认的maven全局设置
TestNg文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Entution v1.1">
<test name="Purchase Order Form">
<classes>
<class name="Procurement._01_PurchaseOrder.TestCases.TestCase_13_Procurement_PurchaseOrder" />
</classes>
</test>
<test name="Inbound Shipment Form">
<classes>
<class name="Procurement._01_PurchaseOrder.TestCases.TestCase_13_Procurement_InboundShipment" />
</classes>
</test>
<test name="Purchase Invoice">
<classes>
<class name="Procurement._01_PurchaseOrder.TestCases.TestCase_13_Procurement_PurchaseInvoice" />
</classes>
</test>
</suite>
&#13;
POM文件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test11</groupId>
<artifactId>test11</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-core</artifactId>
<version>2.68</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>TestNgSuite.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
<!-- https://mvnrepository.com/artifact/org.jenkins-ci.main/jenkins-core -->
</project>
&#13;
答案 0 :(得分:0)
我删除了属于Jenkins的POM.xml文件中的所有依赖项。问题解决了......