如何使 Redline RPM 库与 Ant 一起使用? [英] How to make Redline RPM Library work with Ant?
问题描述
我使用 Ant 作为构建工具,一开始我就把这行代码放到我的 Ant 脚本中:
I use Ant as a build tool, I put this line into my Ant script at the very beginning:
<taskdef name="pure-java-rpm" classname="org.redline_rpm.ant.RedlineTask" classpath="lib/ant/redline-1.1.16.jar" />
我更进一步:
<pure-java-rpm group="Games" name="${project-unix-name}" version="0" destination="${destdir}">
<zipfileset prefix="/usr/share/games/${project-unix-name}" file="${destdir}/${game-jar-filename}"/>
<depends name="java" version=">= 1.7"/>
</pure-java-rpm>
我收到以下错误消息:构建失败/home/gouessej/Documents/programmation/java/workspace/tuer/build.xml:445: java.lang.NoClassDefFoundError: org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream
I get the following error message: BUILD FAILED /home/gouessej/Documents/programmation/java/workspace/tuer/build.xml:445: java.lang.NoClassDefFoundError: org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream
然而,没有提到Apache Commons Compress,根据使用"页面.我真的必须将 Apache Commons Compress 添加到此任务定义的类路径中才能使其工作吗?还有其他解决方案吗?
However, Apache Commons Compress isn't mentioned, it doesn't seem to be a dependency of this library according to the "usage" page. Do I really have to add Apache Commons Compress into the classpath of this task definition to make it work? Is there another solution?
推荐答案
说明书没有提到依赖,你至少需要 SLF4J、Bountycastle、XZ 和 Apache Commons Compress 才能使用 Redline RPM.我刚刚修改了我的任务定义:
The instructions don't mention the dependencies, you need at least SLF4J, Bountycastle, XZ and Apache Commons Compress to use Redline RPM. I've just modified my task definition:
<taskdef name="pure-java-rpm" classname="org.redline_rpm.ant.RedlineTask">
<classpath>
<pathelement path="bcpg-jdk15on-151.jar"/>
<pathelement path="commons-compress-1.8.1.jar"/>
<pathelement path="slf4j-api-1.7.7.jar"/>
<pathelement path="slf4j-simple-1.7.7.jar"/>
<pathelement path="xz-1.4.jar"/>
<pathelement path="redline-1.1.16.jar"/>
</classpath>
</taskdef>
您可以在此处找到这些 JAR:
You can find those JARs here:
这篇关于如何使 Redline RPM 库与 Ant 一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!