2011-12-06 3 views
1

Android 빌드 스크립트가 있습니다. Ant 프로젝트 대신 Gant 작업을 사용하여 프로젝트에서 수행 된 사용자 정의 작업을 시도합니다.Ant 스크립트 내에서 Gant 작업을 실행할 때 NoClassDefFoundError

<taskdef name="gant" classname="org.codehaus.gant.ant.Gant"> 
    <classpath> 
     <pathelement location="${gant.dir}/gant-1.9.7_groovy-1.8.4.jar" /> 
    </classpath> 
</taskdef> 

<target name="-pre-build"> 
    <gant target="targetA"/> 
    <gant target="targetB"/> 
    <gant target="targetC"/> 
    <gant target="targetD"/> 
    <gant target="targetE"/> 
</target> 

<target name="-pre-compile"> 
    <gant target="targetF"/> 
</target> 


내 build.gant 파일이 확실히 그 목표를 가지고 있지만, 개미와 빌드 스크립트를 실행할 때 내가 얻을 :

(...)\build.xml:55: java.lang.NoClassDefFoundError: groovy/util/AntBuilder 

을 즉시 개미 안타로 흥미로운 빌드 스크립트의 일부는 다음과 같은 방법을 찾습니다 라인 :

<gant target="targetA"/> 


나는 개미 볼 수있는 Windows 설치 파일과 이클립스 헬리오스에서 설치 겐트와 그루비 1.8.4를 사용합니다. Gant.dir 속성은 유효한 경로를 가지고 있으므로 그렇지 않습니다. Groovy가 build.gant 파일 내에 타겟을 찾을 수없는 것처럼 보입니다. Gant 작업을 전체 경로와 함께 사용하여 build.gant 파일을 제공하려했지만 성공하지 못했습니다. Ant 스크립트를 콘솔에서 실행할 때도 마찬가지입니다. Build.gant 파일은 Ant 스크립트에서 볼 수 있습니다.

이 문제를 해결할 방법이 있습니까?

답변

0

그래서 build.gant 내부의 보이지 않는 대상에는 문제가 없었지만 taskdef의 클래스 경로에는 누락 된 라이브러리가있었습니다. 다음 수정 내 문제 :

gant.libs.dir가 갠트 1.9.7 바이너리 독립에서 gant_groovy1.8-1.9.7.jar와 그루비 모두-1.8.4.jar를 포함하는 디렉토리를 참조
<path id="gant.libs"> 
    <fileset dir="${gant.libs.dir}" includes="**/*.jar"/> 
</path> 

<taskdef name="gant" classname="org.codehaus.gant.ant.Gant"> 
    <classpath refid="gant.libs"/> 
</taskdef> 

<target name="-pre-build"> 
    <gant target="targetA"/> 
    <gant target="targetB"/> 
    <gant target="targetC"/> 
    <gant target="targetD"/> 
    <gant target="targetE"/> 
</target> 

<target name="-pre-compile"> 
    <gant target="targetF"/> 
</target> 

설치 zip 파일.

관련 문제