1
나는 이클립스와 함께 사용할 때 .jar 파일을 생성하고 ok를 실행하는 ant 스크립트를 작성했습니다. 하지만 Windows XP에서 명령 프롬프트에서 사용하면 성공적으로 표시되지만 아무 일도 일어나지 않습니다. 개미가 제대로 구성되어 있고 다른 개미 스크립트도 실행할 수 있습니다. 당신이 (당신의 사건 clean
단위) build.xml
파일에 정의 된 첫 번째 목표를 실행 명령 줄에서 개미 스크립트를 실행하면ant 빌드 스크립트가 명령 줄을 사용하여 Windows에서 실행되지 않습니다.
여기 내 build.xml 파일
<?xml version="1.0"?>
<project name="TaskNodeBundle" basedir=".">
<!-- Sets variables which can later be used. -->
<!-- The value of a property is accessed via ${} -->
<property name="bundlename" value="task-node-bundle" />
<property name="src.dir" location="../src" />
<property name="lib.dir" location="../lib" />
<property name="build.dir" location="/buildoutput" />
<property name="build.dest" location="build/dest" />
<!--
Create a classpath container which can be later used in the ant task
-->
<path id="classpath">
<fileset dir="${lib.dir}/">
<include name="*.jar" />
</fileset>
</path>
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${build.dest}" />
</target>
<!-- Deletes the existing build directory-->
<target name="mkdir" depends="clean">
<mkdir dir="${build.dest}"/>
</target>
<!-- Compiles the java code -->
<target name="compile" depends="mkdir">
<javac srcdir="${src.dir}" destdir="${build.dest}" classpathref="classpath" />
</target>
<target name="package-bundle" depends="compile" description="Generates the bundle">
<jar destfile="${dist.dir}/${bundlename}.jar">
<fileset dir="${src.dir}">
<include name="**/**.class" />
<include name="**/**.properties"/>
<include name="/META-INF/**.*" />
<include name="/META-INF/spring/**.*" />
</fileset>
</jar>
</target>
</project>
어떻게 실행합니까? 명령 줄에서 어느 대상을 지정합니까? 방금 "개미"라고 부르는 경우 파일을 "깨끗하게"하는 첫 번째 대상이됩니다. – Matteo
을 입력하여 ant 및 build.xml을 지정하면 – vicky
디렉토리에 있습니다. 문제가 해결되었습니다. – vicky