2013-09-30 47 views
1

我已經歷了許多帖子和博客,但無法通過maven生成reportngtestng-xslt報告。最後,我得到了this教程,但沒有運氣。我不明白我錯過了什麼。
以下是我嘗試過的:它成功生成目標文件夾中的surefire報告,但不會爲reportng報告創建(生成報告)目錄。Pom.xml無法爲reportng結果創建輸出目錄

<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/maven-v4_0_0.xsd"> 

    <modelVersion>4.0.0</modelVersion> 

    <groupId>org.testng.xslt</groupId> 
    <artifactId>testng-xslt-plugin</artifactId> 
    <packaging>maven-plugin</packaging> 
    <name>TestNG XSLT Maven Plugin</name> 
    <version>1.2</version> 

    <prerequisites> 
     <maven>2.0.4</maven> 
    </prerequisites> 

    <developers> 
     <developer> 
      <id>cosminaru</id> 
      <name>Cosmin Marginean</name> 
      <email>[email protected]</email> 
     </developer> 
    </developers> 

    <licenses> 
     <license> 
      <name>The Apache Software License, Version 2.0</name> 
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> 
      <distribution>repo</distribution> 
     </license> 
    </licenses> 
    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>2.14.1</version> 
       <configuration> 
        <suiteXmlFiles> 
         <suiteXmlFile>C:/Users/paul/Desktop/reporty-ng-1.2/testng.xml</suiteXmlFile> 
        </suiteXmlFiles> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 
    <reporting> 
     <plugins> 
      <plugin> 
       <groupId>org.reportyng</groupId> 
       <artifactId>reporty-ng</artifactId> 
       <version>1.2</version> 
       <configuration> 
        <surefireReportDirectory>C:/Users/paul/Desktop/reporty-ng-1.2/target/surefire-reports</surefireReportDirectory> 
        <!--Setting the output directory --> 
        <outputDir>C:/Users/paul/workspace/windowspc/target/site/testng-xslt-plugin</outputDir> 
        <!--Setting the testNgXslt.showRuntimeTotals flag --> 
        <showRuntimeTotals>true</showRuntimeTotals> 
        <!--Setting the testNgXslt.cssFile parameter. This should be relative 
         to the '${basedir}/target/site/testng-xslt' directory --> 
        <sortTestCaseLinks>true</sortTestCaseLinks> 
        <testDetailsFilter>FAIL,PASS,SKIP,CONF</testDetailsFilter> 
       </configuration> 
      </plugin> 
     </plugins> 
    </reporting> 

    <dependencies> 
     <dependency> 
      <groupId>org.apache.maven</groupId> 
      <artifactId>maven-plugin-api</artifactId> 
      <version>2.0.4</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.maven.reporting</groupId> 
      <artifactId>maven-reporting-api</artifactId> 
      <version>2.0</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.maven.reporting</groupId> 
      <artifactId>maven-reporting-impl</artifactId> 
      <version>2.0</version> 
     </dependency> 
     <dependency> 
      <groupId>net.sf.saxon</groupId> 
      <artifactId>saxon</artifactId> 
      <version>8.7</version> 
     </dependency> 

     <!-- selenium and testng --> 
     <dependency> 
      <groupId>org.seleniumhq.selenium</groupId> 
      <artifactId>selenium-server</artifactId> 
      <version>2.34.0</version> 
     </dependency> 
     <dependency> 
      <groupId>org.seleniumhq.selenium</groupId> 
      <artifactId>selenium-java</artifactId> 
      <version>2.34.0</version> 
     </dependency> 
     <dependency> 
      <groupId>org.seleniumhq.selenium</groupId> 
      <artifactId>selenium-support</artifactId> 
      <version>2.34.0</version> 
     </dependency> 
     <dependency> 
      <groupId>org.seleniumhq.selenium</groupId> 
      <artifactId>selenium-api</artifactId> 
      <version>2.34.0</version> 
     </dependency> 
     <dependency> 
      <groupId>org.testng</groupId> 
      <artifactId>testng</artifactId> 
      <version>6.3.1</version> 
      <scope>test</scope> 
     </dependency> 
     <!-- selenium and testng --> 

    </dependencies> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>reporty-ng</id> 
      <url>https://github.com/cosminaru/reporty-ng/raw/master/dist/maven</url> 
     </pluginRepository> 
    </pluginRepositories> 

</project> 
+0

可能重複的[Maven的/神火沒有找到的單元測試](http://stackoverflow.com/questions/5534597/maven-surefire-not-finding-unit-tests) –

回答