首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ant in Ant in Maven:如何添加可选任务?

Ant in Ant in Maven:如何添加可选任务?
EN

Stack Overflow用户
提问于 2011-10-14 17:17:58
回答 1查看 2.5K关注 0票数 3

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

代码语言:javascript
复制
        <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>

然而,我得到了这样的结论:

代码语言:javascript
复制
[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

我应该添加什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-10-17 11:08:42

糟了。这个类真的不存在-它是在ant-junit中。因此,所需的依赖关系是:

代码语言:javascript
复制
                <dependency>
                    <groupId>ant</groupId>
                    <artifactId>ant-junit</artifactId>
                    <version>1.6.5</version>
                </dependency>
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7765530

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档