简体   繁体   English

如何使Redline RPM库与Ant一起使用?

[英]How to make Redline RPM Library work with Ant?

I use Ant as a build tool, I put this line into my Ant script at the very beginning: 我使用Ant作为构建工具,一开始就将此行放入Ant脚本中:

<taskdef name="pure-java-rpm" classname="org.redline_rpm.ant.RedlineTask" classpath="lib/ant/redline-1.1.16.jar" />

I call it further: 我进一步称呼它:

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

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 我收到以下错误消息:BUILD FAILED /home/gouessej/Documents/programmation/java/workspace/tuer/build.xml:445:java.lang.NoClassDefFoundError:org / apache / commons / compress / compressors / bzip2 / BZip2CompressorInputStream

However, Apache Commons Compress isn't mentioned, it doesn't seem to be a dependency of this library according to the "usage" page . 但是,没有提到Apache Commons Compress,根据“使用情况”页面 ,它似乎并不是该库的依赖项。 Do I really have to add Apache Commons Compress into the classpath of this task definition to make it work? 我是否真的必须将Apache Commons Compress添加到此任务定义的类路径中才能使其工作? Is there another solution? 还有其他解决方案吗?

The instructions don't mention the dependencies, you need at least SLF4J, Bountycastle, XZ and Apache Commons Compress to use Redline RPM. 这些说明没有提及依赖关系,您至少需要SLF4J,Bountycastle,XZ和Apache Commons Compress才能使用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>

You can find those JARs here: 您可以在这里找到这些JAR:

Apache Commons Compress Apache Commons Compress

Bouncycastle 充气城堡

SLF4J SLF4J

XZ XZ

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM