1

I am trying to generate TestNG XSLT report using the Maven setup for selenium Tests.

http://code.google.com/p/testng-xslt/

I have configured the pom file with Maven plugin specified as above, but I am always getting plugin not found error. I am getting default TestNT report and not the XSLT report with chart.

Pom.xml used for the Test

<modelVersion>4.0.0</modelVersion>
<groupId>uk.co.newsint.acs.admin.test</groupId>
<artifactId>ACS</artifactId>
<packaging>jar</packaging>
<version>1.0</version>

<dependencies>

    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.1.1</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.25.0</version>
    </dependency>
</dependencies>

<pluginRepositories>
    <pluginRepository>
        <id>testng-xslt-plugin</id>
        <url>http://www.cosminaru.ro/maven/</url>
    </pluginRepository>
</pluginRepositories>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.4</version>
           <configuration>
                 <testFailureIgnore>true</testFailureIgnore>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.5</source>
                <target>1.5</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<reporting>
    <plugins>
        <plugin>
            <groupId>org.testng.xslt</groupId>
            <artifactId>testng-xslt-plugin</artifactId>
            <version>1.1</version>
            <configuration>
                <showRuntimeTotals>true</showRuntimeTotals>
                <sortTestCaseLinks>true</sortTestCaseLinks>
                <testDetailsFilter>FAIL,PASS,SKIP,CONF</testDetailsFilter>
            </configuration>
        </plugin>
    </plugins>
</reporting>

4

2 回答 2

1

首先,您为什么要使用这么旧的maven-surefire-plugin版本?当前版本是 2.12.4...此外,您不应该在 pom 中定义存储库,最好使用存储库管理器。根据文档,您对存储库的定义是错误的。它应该是:

<pluginRepositories>
   <pluginRepository>
       <id>testng-xslt-plugin</id>
       <url>http://uhftopic.com/maven/</url>
   </pluginRepository>
</pluginRepositories>

BTW:你怎么称呼maven?mvn 网站获取新报告?

于 2012-11-03T17:58:51.730 回答
0

对不起,khmarbaise 的帖子不是答案。我没有足够的声望点来添加评论,但我想提醒一下,使用http://uhftopic.com/maven/是不正确的,因为它显示为离线。请看这篇文章 Unable to generate XSLT in maven project

于 2013-09-27T09:41:37.647 回答