[英]How to install org.apache.tools.ant.taskdefs.optional.Rpm for ant
I'm trying to launch: 我正在尝试启动:
ant rpm
command where my build.xml at line #126 looks like: 第126行的build.xml如下所示的命令:
<rpm specFile="whatever.spec" topDir="${basedir}/rpm" command="-bb" failOnError="true" />
I'm getting the error: 我收到错误消息:
build.xml:126: Problem: failed to create task or type rpm
Cause: the class org.apache.tools.ant.taskdefs.optional.Rpm was not found.
This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
-/usr/share/ant/lib
-/export/home/myuser/.ant/lib
-a directory added on the command line with the -lib argument
I downloaded ant-nodeps-1.7.1.jar which contains: 我下载了ant-nodeps-1.7.1.jar,其中包含:
jar tvf ant-nodeps-1.7.1.jar | grep Rpm
7171 Fri Jun 27 05:03:48 CEST 2008 org/apache/tools/ant/taskdefs/optional/Rpm.class
I placed this jar file to directory: /usr/share/ant/lib 我将此jar文件放置到目录:/ usr / share / ant / lib
ant-1.7.0.jar -> ../../java/ant-1.7.0.jar
ant.jar -> ../../java/ant.jar
ant-launcher-1.7.0.jar -> ../../java/ant-launcher-1.7.0.jar
ant-launcher.jar -> ../../java/ant-launcher.jar
ant-nodeps-1.7.1.jar
but still getting that build error. 但仍然出现该构建错误。 I tried also with commands:
我也尝试使用命令:
ant -lib /usr/share/ant/lib rpm
ant -lib /usr/share/ant/lib/ant-nodeps-1.7.1.jar rpm
ant -lib ant-nodeps-1.7.1.jar rpm
whithout succes, getting the same error. 如果没有成功,将得到相同的错误。 What is missing, what I need to do ?
缺少什么,我需要做什么?
Thanks ! 谢谢 !
cd into your ANT_HOME directory and run ant -f fetch.xml -Ddest=system
This will download the optional ant dependencies you need to ant rpm
. cd进入ANT_HOME目录并运行
ant -f fetch.xml -Ddest=system
这将下载您需要的ant依赖项ant rpm
。
This is from the ant install guide . 这来自ant安装指南 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.