2014-07-14 41 views
0

目前,我正在嘗試讓我的ReportNG報告在「項目報告」部分下的「站點」中生成。ReportNG和Maven站點:需要幫助在Maven站點生成ReportNG輸出

的ReportNG文件夾製成,並且index.html與文件在我的目錄中生成我的電腦上,並測試運行和輸出正確的結果。

我只想在Project Reports部分下創建ReportNG報告。

僅供參考,上週我剛開始使用Maven作爲我工作的一部分。

請讓我知道什麼,我能做些什麼來解決這個問題無論是得到一個新的插件,或者一個新的依賴或我需要修改的內容。

此外,如果你知道任何資源來理解Maven,我將非常感激。

<?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/maven-v4_0_0.xsd"> 
<modelVersion>4.0.0</modelVersion> 
<groupId>com.Test.app</groupId> 
<artifactId>mavenTestNG</artifactId> 
<packaging>jar</packaging> 
<version>1.0-SNAPSHOT</version> 

<dependencies> 
    <!-- tag::joda[] --> 
    <dependency> 
     <groupId>joda-time</groupId> 
     <artifactId>joda-time</artifactId> 
     <version>2.2</version> 
    </dependency> 
    <!-- end::joda[] --> 
    <dependency> 
    <groupId>org.uncommons</groupId> 
    <artifactId>reportng</artifactId> 
    <version>1.1.2</version> 
    <scope>test</scope> 
    <exclusions> 
     <exclusion> 
      <groupId>org.testng</groupId> 
      <artifactId>testng</artifactId> 
     </exclusion> 
    </exclusions> 
</dependency> 
    <!-- tag::junit[] --> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>3.8.1</version> 
     <scope>test</scope> 
    </dependency> 
    <!-- end::junit[] --> 
    <!-- tag::spring[] --> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-context</artifactId> 
     <version>4.0.6.RELEASE</version> 
    </dependency> 
    <!-- end::spring[] --> 
    <!-- tag::testng[] --> 
    <dependency> 
     <groupId>org.testng</groupId> 
     <artifactId>testng</artifactId> 
     <version>6.8.7</version> 
     <scope>test</scope> 
    </dependency> 
    <!-- end::testng[] --> 
    <dependency> 
     <groupId>com.google.inject</groupId> 
     <artifactId>guice</artifactId> 
     <version>3.0</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>velocity</groupId> 
     <artifactId>velocity</artifactId> 
     <version>1.4</version> 
     <scope>test</scope> 
    </dependency> 
</dependencies> 


<build> 
    <plugins> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-surefire-plugin</artifactId> 
     <configuration> 
      <properties> 
       <property> 
        <name>usedefaultlisteners</name> 
        <value>true</value> 
       </property> 
       <property> 
        <name>listener</name> 
        <value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value> 
       </property> 
      </properties> 
      <workingDirectory>target/</workingDirectory> 
     </configuration> 
    </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-shade-plugin</artifactId> 
      <version>2.1</version> 
      <executions> 
       <execution> 
        <phase>package</phase> 
        <goals> 
         <goal>shade</goal> 
        </goals> 
        <configuration> 
         <transformers> 
          <transformer 
           implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> 
           <mainClass>com.Test.app.HelloWorld</mainClass> 
          </transformer> 
         </transformers> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
</build> 
<reporting> 
<plugins> 
    <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-surefire-report-plugin</artifactId> 
     <version>2.6</version> 
     <configuration> 
      <properties> 
       <property> 
        <name>usedefaultlisteners</name> 
        <value>true</value> 
       </property> 
       <property> 
        <name>listener</name> 
        <value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value> 
       </property> 
      </properties> 
      <workingDirectory>target/</workingDirectory> 
     </configuration> 
    </plugin> 
</plugins> 


回答

0
</plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.6</version> 
      <configuration> 
       <!-- You can specify a specific testng.xml file here <suiteXmlFiles> 
        <suiteXmlFile>src/test/resources/testng-sample.xml</suiteXmlFile> </suiteXmlFiles> --> 
       <!-- Or dynamically with something like '-DsuiteXmlFile=src/test/resources/testng-sample.xml' --> 
       <suiteXmlFiles> 
        <suiteXmlFile>${suiteXmlFile}</suiteXmlFile> 
       </suiteXmlFiles> 
       <!-- Build with '-DskipTests=true' to bypass test execution @ build 
        time Default: false --> 
       <skipTests>${skipTests}</skipTests> 
       <testFailureIgnore>true</testFailureIgnore> 
      </configuration> 
     </plugin>