【发布时间】:2019-07-25 11:45:47
【问题描述】:
我正在测试自动化工程师,我已经为自动化脚本配置了 Jenkins 和 maven 项目,几天前我的所有脚本在 Jenkins 和本地运行良好,但是现在当我通过异常在 Jenkins 和本地系统中运行构建时,在本地,当我尝试更新我的 maven 项目并通过命令“maven test”运行脚本时,它工作正常,并且当我尝试运行命令“maven clean”然后运行命令作为“maven test”运行时,所有脚本都在运行,然后系统生成我一个错误,当我尝试从 jenkins 运行相同的 porm.xml 文件而不使用命令“clean test”时,它工作正常但命令总是面临同样的异常 . “错误] 无法在项目 EventBuizz 上执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile):编译失败 [错误] /E:/Automation/eclipse-workspace/EventBuizz/src/test/java/EventBuizz/EventBuizz/EventCenterDashBoard.java:[21,34] 包 org.apache.tools.ant.types 不存在 [错误] -> [帮助 1] [错误] [错误] 要查看错误的完整堆栈跟踪,请使用 -e 开关重新运行 Maven。 [错误] 使用 -X 开关重新运行 Maven 以启用完整的调试日志记录。 [错误] [ERROR] 有关错误和可能的解决方案的更多信息,请阅读以下文章:"
我已经查看了其他帖子,并按照建议对我的 .pom 文件进行了一些更改,但我仍然遇到同样的错误。不确定要提供哪些其他有用的信息,因此请告诉我哪些其他信息对解决此问题有用。下面是我的 .pom 文件
<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>EventBuizz</groupId>
<artifactId>EventBuizz</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-dependency-tree</artifactId>
<version>3.0.1</version>
</dependency>
<!-- Selenium -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<!-- TestNG -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
<!--JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<!--Maven Plugin -->
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<type>maven-plugin</type>
</dependency>
<!--Extent Report -->
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.2</version>
</dependency>
<dependency>
<!-- jsoup HTML parser library @ https://jsoup.org/-->
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.12.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<!--Maven Plugin -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
</configuration>
</plugin>
<!--Maven surfire plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.8</version>
<configuration>
<printSummary>true</printSummary>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
我想使用命令“clean test”在 jenkins 中运行我的测试脚本。
【问题讨论】:
标签: java maven selenium jenkins java-11