Java ANT问题:net/sf/antcontrib/antcontrib.properties
我正试图在我的Debian Lenny服务器上安装软件。具体来说,捕获HPC。我已经安装了VMWare server以及所有先决条件。在目录中运行ant时,出现以下错误:Java ANT问题:net/sf/antcontrib/antcontrib.properties,java,ant,debian,hpc,Java,Ant,Debian,Hpc,我正试图在我的Debian Lenny服务器上安装软件。具体来说,捕获HPC。我已经安装了VMWare server以及所有先决条件。在目录中运行ant时,出现以下错误: [taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found. 有人知道这是什么原因吗?有关我的ant安装的详细信息如下: Apache Ant version
[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>
此错误消息表示您正试图加载非核心任务,但进一步定义该任务的资源不存在(或不在预期的位置) 请参阅安装说明 你也可以
ant contrib
jar并将其放入ant
安装中(根据上面链接中的选项1);或Linux/Debian解决方案:
apt-get install ant-contrib
export CLASSPATH=/usr/share/java/ant-contrib.jar
Ubuntu解决方案:
sudo apt-get install ant-contrib
sudo ln -s /usr/share/java/ant-contrib.jar /usr/share/ant/lib/
CentOS/RHEL的解决方案:
sudo-yum安装ant-contrib已更新。你有ant contrib罐子吗?我在哪里找这个?我下载了ant contrib,但在下载的文件中似乎找不到它。我不太熟悉ant。你下载了ant-contrib-1.0b3-bin.zip吗?在里面你会发现ant-contrib-1.0b3.jar。忽略其余的文件。将jar文件放在ant安装中的lib目录中,然后重试。您是对的。需要将ant contrib-{version}.jar移动到my lib/安装antcontrib后,您应该在构建脚本中使用net/sf/antcontrib/antcontrib.properties作为引用。properties仅包含ant 1.6.x之前的ant版本的任务