相关疑难解决方法(0)

如何从Maven中的pom.xml调用testng.xml文件

我正在使用Selenium WebDriver,Eclipse,TestNG和Surefire插件.我无法从pom.xml运行testng.xml文件.当我使用mvn test运行pom.xml时,它直接运行src/test/java中的文件.

我的pom.xml代码是

<groupId>angel</groupId>
<artifactId>Angel</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Angel</name>  
<url>http://maven.apache.org</url>

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

<dependencies>
          <!-- Java API to access the Client Driver Protocols -->
 <dependency>
     <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.21.0</version>
 </dependency>
  <!-- JExcel API is a java library which provides the ability to read, write, and                 modify Microsoft Excel spreadsheets.-->
  <dependency>
     <groupId>net.sourceforge.jexcelapi</groupId>
    <artifactId>jxl</artifactId>
    <version>2.6.10</version>
    </dependency>
   <dependency>
  <groupId>log4j</groupId>
  <artifactId>log4j</artifactId>
  <version>1.2.14</version>
</dependency>
 <!-- Java API for manipulate the Microsoft Excel Sheets.  -->  
 <dependency>  
<groupId>org.apache.poi</groupId>  
<artifactId>poi-contrib</artifactId> 
 <version>3.5-beta5</version>   
 </dependency>
 <!-- Java Mail …
Run Code Online (Sandbox Code Playgroud)

testng maven-2 maven-plugin pom.xml

10
推荐指数
2
解决办法
6万
查看次数

标签 统计

maven-2 ×1

maven-plugin ×1

pom.xml ×1

testng ×1