开发者

Ant in Ant in Maven: How to add optional tasks?

I'm trying to run junitreport task in Ant in Ant in Maven:

        <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>

However, I am getting this:

[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 look开发者_JAVA百科s 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

What should I add?


Oops. The class really wasn't present - it was in ant-junit. So the needed dependency is:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜