2010-10-25 14 views
22

Próbuję zainstalować oprogramowanie na moim serwerze Debian Lenny. W szczególności Capture-HPC. Mam zainstalowany serwer VMWare wraz z wszystkimi wymaganiami wstępnymi. Kiedy idę do uruchomienia mrówka w katalogu, pojawia się następujący błąd:ANT Problemy: net/sf/antcontrib/antcontrib.properties

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

Ktoś ma jakieś pomysły, co jest przyczyną tego? Szczegóły dotyczące instalacji mrówek:

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 

I plik 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> 
+0

Po instalując antcontrib powinieneś użyć do odwoływania się do twoich skryptów budowania jako net/sf/antcontrib/antcontrib.properties zawiera tylko zadania dla wersji ant, zanim Ant 1.6.x – Rebse

Odpowiedz

27

Ten komunikat o błędzie wskazuje, że próbujesz załadować zadania non-core, ale zasób, który dodatkowo określa zadania nie występuje (lub nie, gdzie oczekiwano).

Patrz instrukcja montażu here.

Można

  1. find/pobrać ant-contrib słoik i umieścić go w swojej instalacji ant (jak w wariancie 1 w linku powyżej); lub
  2. Zmodyfikuj plik ant (zgodnie z opcją 2 w powyższym łączu), aby dołączyć słoik z ant-contrib w zagnieżdżonej ścieżce klas.
+0

został zaktualizowany. Czy masz słoik ant-contrib? – Synesso

+0

Gdzie mogę tego szukać? Pobrałem ant-contrib, ale nie mogę go znaleźć w pobranych plikach. Nie jestem dobrze zaznajomiony z mrówką. – Julio

+2

Pobrałeś ant-contrib-1.0b3-bin.zip? W środku znajdziesz ant-contrib-1.0b3.jar. Zignoruj ​​pozostałe pliki. Umieść plik jar w katalogu lib wewnątrz instalacji ant i spróbuj ponownie. – Synesso

6

Rozwiązanie dla Linux/Debian:

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

Rozwiązanie dla Ubuntu:

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

rozwiązanie dla CentOS/RHEL:

sudo yum install ant-contrib