问题描述
当我尝试运行此cli命令时,收到关于缺少TestNG依赖项的错误消息:
MVN干净测试-DsuiteXmlFile = TESTFILE.xml
如果我将org.testng依赖项添加到pom中,错误就会消失。问题是,在我的POM文件中调出的“ myframework”依赖项包含org.testng依赖项(以及许多其他依赖项)。为什么不使用我在POM中调用的“ myframework”依赖项中捆绑的org.testng依赖项?我想念什么?
这是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>test</groupId>
<artifactId>zTestAF</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com</groupId>
<artifactId>MyFramework</artifactId>
<version>1.3.3</version>
<scope>system</scope>
<systemPath>/users/me/QA/myframework/target/com.myframework-1.3.3-jar-with-dependencies.jar</systemPath>
</dependency>
</dependencies>
<properties>
<suiteXmlFile>TESTFILE.xml</suiteXmlFile>
</properties>
<build>
<!--defaultGoal>integration-test</defaultGoal-->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<useIncrementalCompilation>true</useIncrementalCompilation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<suiteXmlFiles>
TestNG suite XML files. This needs to be changed accordingly. List Sanity,Smoke XMLs
<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)