ANT 问题:net/sf/antcontrib/antcontrib.properties

发布于 2024-09-29 09:45:01 字数 4143 浏览 8 评论 0原文

我正在尝试将软件安装到我的 Debian Lenny 服务器上。具体来说,Capture-HPC。我已经设置了 VMWare 服务器以及所有先决条件。当我在目录中运行 ant 时,出现以下错误:

[taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.

有人知道是什么原因造成的吗?有关我的 ant 安装的详细信息如下:

Apache Ant version 1.7.0 compiled on April 29 2008
Buildfile: build.xml
Detected Java version: 1.6 in: /usr/lib/jvm/java-6-sun-1.6.0.20/jre
Detected OS: Linux

以及 build.xml 文件。 。 。

<?xml version="1.0"?>
<project name="CaptureServer" xmlns:ac="antlib:net.sf.antcontrib" default="release" basedir=".">
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

<condition property="os" value="unix">
    <os family="unix"/>
</condition>
<condition property="os" value="windows">
    <os family="windows"/>
</condition>

 <property environment="env"/>
 <property name="src" value="."/>
 <property name="build" value="build"/>
 <property name="lib" value="lib"/>
 <property name="release" value="release"/>
 <property name="classpath.build" value=".\lib\junit-4.4.jar"/>
 <property name="classpath.run" value="lib/junit-4.4.jar"/>


 <path id="classpath">
    <fileset dir="${lib}">
        <include name="*.jar"/>
    </fileset>
 </path>

 <target name="init">
      <mkdir dir="${build}"/>
      <mkdir dir="${release}"/>
 </target>

 <target name="compile" depends="init">
      <!-- Compile the java code -->         
      <javac srcdir="${src}" destdir="${build}" debug="true" debuglevel="lines,vars,source" classpath="${classpath.build}"/>

      <!-- Compile the revert code -->
      <if>
       <equals arg1="${os}" arg2="windows" />
       <then>
       <exec executable="compile_revert_win32.bat"/>
       </then>
      <else>
       <exec command="sh" executable="./compile_revert_linux.sh"/>
      </else>
     </if>

 </target>

 <target name="jar" depends="compile">
    <mkdir dir="${build}/jar"/>
    <jar destfile="${build}/jar/CaptureServer.jar" basedir="${build}">
        <manifest>
            <attribute name="Class-Path" value="${classpath.run}"/>
            <attribute name="Main-Class" value="capture.Server"/>
        </manifest>
    </jar>
</target>

<target name="release" depends="clean,compile,jar">
    <copy file="${build}/jar/CaptureServer.jar" todir="${release}"/>
    <copy file="./COPYING" todir="${release}"/>
    <copy file="./Readme.txt" todir="${release}"/>
    <copy file="./preprocessor_README.txt" todir="${release}"/>
    <copy file="./input_urls_example.txt" todir="${release}"/>
    <copy file="./config.xsd" todir="${release}"/>
    <copy file="./config.xml" todir="${release}"/>
    <copy todir="${release}/${lib}">
        <fileset dir="lib"/>
    </copy>

    <if>
       <equals arg1="${os}" arg2="windows" />
       <then>
        <copy file="${env.VIX_HOME}/libeay32.dll" todir="${release}"/>
        <copy file="${env.VIX_HOME}/ssleay32.dll" todir="${release}"/>
        <copy file="${env.VIX_HOME}/vix.dll" todir="${release}"/>
        <copy file="./revert.exe" todir="${release}"/>
       </then>
      <else>
        <exec executable="cp">
          <arg value="./revert"/>
          <arg value="${release}"/>
        </exec>
      </else>
     </if>  

    <zip destfile="./CaptureServer-Release.zip" basedir="release"/>
</target>

<target name="clean">
    <delete dir="${build}"/>
    <delete dir="${release}"/>
    <delete>
        <fileset dir="." includes="revert.exe"/>
        <fileset dir="." includes="revert"/>
        <fileset dir="." includes="CaptureServer-Release.zip"/>
    </delete>
</target>
</project>

I am attempting to install software onto my Debian Lenny server. Specifically, Capture-HPC. I have setup VMWare server, along with all the prerequisites. When I go to run ant in the directory, i get the following error:

[taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.

Anyone have any ideas what is causing this? Details about my ant installation follow:

Apache Ant version 1.7.0 compiled on April 29 2008
Buildfile: build.xml
Detected Java version: 1.6 in: /usr/lib/jvm/java-6-sun-1.6.0.20/jre
Detected OS: Linux

And the build.xml file . . .

<?xml version="1.0"?>
<project name="CaptureServer" xmlns:ac="antlib:net.sf.antcontrib" default="release" basedir=".">
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

<condition property="os" value="unix">
    <os family="unix"/>
</condition>
<condition property="os" value="windows">
    <os family="windows"/>
</condition>

 <property environment="env"/>
 <property name="src" value="."/>
 <property name="build" value="build"/>
 <property name="lib" value="lib"/>
 <property name="release" value="release"/>
 <property name="classpath.build" value=".\lib\junit-4.4.jar"/>
 <property name="classpath.run" value="lib/junit-4.4.jar"/>


 <path id="classpath">
    <fileset dir="${lib}">
        <include name="*.jar"/>
    </fileset>
 </path>

 <target name="init">
      <mkdir dir="${build}"/>
      <mkdir dir="${release}"/>
 </target>

 <target name="compile" depends="init">
      <!-- Compile the java code -->         
      <javac srcdir="${src}" destdir="${build}" debug="true" debuglevel="lines,vars,source" classpath="${classpath.build}"/>

      <!-- Compile the revert code -->
      <if>
       <equals arg1="${os}" arg2="windows" />
       <then>
       <exec executable="compile_revert_win32.bat"/>
       </then>
      <else>
       <exec command="sh" executable="./compile_revert_linux.sh"/>
      </else>
     </if>

 </target>

 <target name="jar" depends="compile">
    <mkdir dir="${build}/jar"/>
    <jar destfile="${build}/jar/CaptureServer.jar" basedir="${build}">
        <manifest>
            <attribute name="Class-Path" value="${classpath.run}"/>
            <attribute name="Main-Class" value="capture.Server"/>
        </manifest>
    </jar>
</target>

<target name="release" depends="clean,compile,jar">
    <copy file="${build}/jar/CaptureServer.jar" todir="${release}"/>
    <copy file="./COPYING" todir="${release}"/>
    <copy file="./Readme.txt" todir="${release}"/>
    <copy file="./preprocessor_README.txt" todir="${release}"/>
    <copy file="./input_urls_example.txt" todir="${release}"/>
    <copy file="./config.xsd" todir="${release}"/>
    <copy file="./config.xml" todir="${release}"/>
    <copy todir="${release}/${lib}">
        <fileset dir="lib"/>
    </copy>

    <if>
       <equals arg1="${os}" arg2="windows" />
       <then>
        <copy file="${env.VIX_HOME}/libeay32.dll" todir="${release}"/>
        <copy file="${env.VIX_HOME}/ssleay32.dll" todir="${release}"/>
        <copy file="${env.VIX_HOME}/vix.dll" todir="${release}"/>
        <copy file="./revert.exe" todir="${release}"/>
       </then>
      <else>
        <exec executable="cp">
          <arg value="./revert"/>
          <arg value="${release}"/>
        </exec>
      </else>
     </if>  

    <zip destfile="./CaptureServer-Release.zip" basedir="release"/>
</target>

<target name="clean">
    <delete dir="${build}"/>
    <delete dir="${release}"/>
    <delete>
        <fileset dir="." includes="revert.exe"/>
        <fileset dir="." includes="revert"/>
        <fileset dir="." includes="CaptureServer-Release.zip"/>
    </delete>
</target>
</project>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

漫雪独思 2024-10-06 09:45:01

此错误消息表明您正在尝试加载非核心任务,但进一步定义该任务的资源不存在(或不在预期位置)。

请参阅此处的安装说明。

您可以

  1. 找到/下载 ant-contrib jar 并将其放入您的 ant 安装中(按照上面链接中的选项 1);或者
  2. 修改您的 ant 文件(按照上面链接中的选项 2)以将 ant-contrib jar 包含在嵌套类路径中。

This error message indicates that you are attempting to load a non-core task, but the resource which further defines the task is not present (or not where expected).

See installation instructions here.

You can either

  1. find/download the ant-contrib jar and put it into your ant installation (as per option 1 in the link above); or
  2. Modify your ant file (as per option 2 in the link above) to include the ant-contrib jar in a nested classpath.
染柒℉ 2024-10-06 09:45:01

Ubuntu 的解决方案:

sudo apt-get install ant-contrib
sudo ln -s /usr/share/java/ant-contrib.jar /usr/share/ant/lib/

Solution for Ubuntu:

sudo apt-get install ant-contrib
sudo ln -s /usr/share/java/ant-contrib.jar /usr/share/ant/lib/
不即不离 2024-10-06 09:45:01

Linux/Debian 的解决方案:

apt-get install ant-contrib
export CLASSPATH=/usr/share/java/ant-contrib.jar

Solution for Linux/Debian:

apt-get install ant-contrib
export CLASSPATH=/usr/share/java/ant-contrib.jar
嘦怹 2024-10-06 09:45:01

CentOS/RHEL 的解决方案:

sudo yum install ant-contrib

Solution for CentOS/RHEL:

sudo yum install ant-contrib

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文