pom.xml配置

<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>shuanghe</groupId>
  <artifactId>medicine</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

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

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

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <!-- httpclient接口請求依賴的jar -->
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
         <artifactId>httpclient</artifactId>
            <version>4.5.2</version>
    </dependency>
    <!-- testNg單元測試框架 -->
    <!-- https://mvnrepository.com/artifact/org.testng/testng -->
    <dependency>
           <groupId>org.testng</groupId>
           <artifactId>testng</artifactId>
           <version>6.9.10</version>
           <scope>test</scope>
    </dependency>
    <!-- 打印測試日誌 -->
    <!-- https://mvnrepository.com/artifact/log4j/log4j -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>
    <!-- 對象解析工具--> 
    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>fastjson</artifactId>
            <version>1.2.47</version>
    </dependency>
    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20180813</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.4.10</version>
    </dependency>
    <!-- reportng報告依賴的模板velocity-dep-->
    <dependency>
        <groupId>velocity</groupId>
        <artifactId>velocity-dep</artifactId>
        <version>1.4</version>
       </dependency>
       <!-- 讀取excel數據--> 
    <dependency>
        <groupId>net.sourceforge.jexcelapi</groupId>
            <artifactId>jxl</artifactId>
        <version>2.6.12</version>
    </dependency>
    <!-- 導入excel模板依賴-->
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.17</version>
    </dependency>
    <!-- 輸出測試報告 關聯testNg-->
    <dependency>
          <groupId>org.uncommons</groupId>
          <artifactId>reportng</artifactId>
          <version>1.1.4</version>
          <exclusions>
              <exclusion>
                  <groupId>org.testng</groupId>
                  <artifactId>testng</artifactId>
              </exclusion>
          </exclusions>
    </dependency>
    <!-- 依賴注入框架 -->
       <dependency>
        <groupId>com.google.inject</groupId>
        <artifactId>guice</artifactId>
        <version>4.0</version>
    </dependency> 
  </dependencies>
  <build>
       <plugins>
         <!-- maven命令執行單元測試時,須要關聯testNg.xml的插件 -->
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.21.0</version>
            <configuration>  
            <testFailureIgnore>true</testFailureIgnore>              
            <suiteXmlFiles>
                   <!--該文件位於工程根目錄時,直接填寫名字,其它位置要加上路徑 -->
                   <suiteXmlFile>shuanghetestng.xml</suiteXmlFile>                  
                   <!-- 調用<proproperties><suiteXmlFile>res/${xmlFileName}</suiteXmlFile> -->
            </suiteXmlFiles>                   
            </configuration>
          </plugin>
          <plugin>                                                                                                                                      
            <!-- 指定maven編譯的jdk版本,若是不指定,maven3默認用jdk 1.5 maven2默認用jdk1.3 -->                                                                           
            <groupId>org.apache.maven.plugins</groupId>                                                                                               
            <artifactId>maven-compiler-plugin</artifactId>                                                                                            
            <version>3.1</version>                                                                                                                    
            <configuration>                                                                                                                           
                <!-- 通常而言,target與source是保持一致的,可是,有時候爲了讓程序能在其餘版本的jdk中運行(對於低版本目標jdk,源代碼中不能使用低版本jdk中不支持的語法),會存在target不一樣於source的狀況 -->                    
                <source>1.8</source> <!-- 源代碼使用的JDK版本 -->                                                                                             
                <target>1.8</target> <!-- 須要生成的目標class文件的編譯版本 -->                                                                                                 
                <testSource>1.8</testSource>    
                <testTarget>1.8</testTarget>          
            </configuration>                                                                                                                          
        </plugin>          
    </plugins>
 </build>
</project>
相關文章
相關標籤/搜索