0

現時点では、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>   


4

1 に答える 1