我正在尝试在Maven的Ant中的Ant中运行junitreport任务:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions combine.children="append">
                <execution>
                    <id>reporting</id>
                    <phase>compile</phase><!--post-integration-test-->
                    <goals><goal>run</goal></goals>
                    <configuration>
                        <target>
                            <ant antfile="${basedir}/../tools/report/buildReports.xml">
                                <!--<property name="reports.dest.dir" value=""/>-->
                                <target name="reports"/>
                            </ant>
                        </target>
                    </configuration>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant-antunit</artifactId>
                    <version>1.2</version>
                </dependency>
                <dependency>
                    <groupId>ant-contrib</groupId>
                    <artifactId>ant-contrib</artifactId>
                    <version>1.0b2</version>
                </dependency>
            </dependencies>
        </plugin>

但是,我得到这个:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (reporting) on project jboss-as-testsuite-integration: An Ant BuildException has occured:     The following error occurred while executing this line:
[ERROR] /home/ondra/work/AS-7/ozizka-as7/testsuite/tools/report/buildReports.xml:42: Problem: failed to create task or type junitreport
[ERROR] Cause: the class org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator     was not found.
[ERROR] This looks like one of Ant's optional components.
[ERROR] Action: Check that the appropriate optional JAR exists in
[ERROR] -ANT_HOME/lib
[ERROR] -the IDE Ant configuration dialogs

我应该添加什么?

最佳答案

哎呀。上课真的不存在-它是在蚁巢中。因此,所需的依赖关系是:

                <dependency>
                    <groupId>ant</groupId>
                    <artifactId>ant-junit</artifactId>
                    <version>1.6.5</version>
                </dependency>

07-28 00:26