gpt4 book ai didi

Maven 中的 Ant : How to add optional tasks?

转载 作者:行者123 更新时间:2023-12-02 00:28:56 27 4
gpt4 key购买 nike

我正在尝试在 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

我应该添加什么?

最佳答案

糟糕。这个类(class)真的不存在——它在 ant-junit 中。所以需要的依赖是:

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

关于Maven 中的 Ant : How to add optional tasks?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7765530/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com