Ant
From Chaehyun
(Difference between revisions)
(2 intermediate revisions not shown) | |||
Line 13: | Line 13: | ||
<property name="classes.dir" value="${basedir}/bin" /> | <property name="classes.dir" value="${basedir}/bin" /> | ||
<property name="jar.dir" value="${basedir}/dist" /> | <property name="jar.dir" value="${basedir}/dist" /> | ||
+ | <property name="jar.name" value="xlos.jar" /> | ||
<target name="dist" depends="jar"> | <target name="dist" depends="jar"> | ||
- | <scp file="${jar.dir}/ | + | <scp file="${jar.dir}/${jar.name}" trust="true" todir="hdfs:****@host:/home/hdfs/users/chaehyun" /> |
</target> | </target> | ||
- | + | ||
<target name="compile" > | <target name="compile" > | ||
<javac srcdir="${src.dir}" destdir="${classes.dir}" /> | <javac srcdir="${src.dir}" destdir="${classes.dir}" /> | ||
</target> | </target> | ||
- | + | ||
<target name="jar" depends="compile"> | <target name="jar" depends="compile"> | ||
- | <jar jarfile="${jar.dir}/ | + | <jar jarfile="${jar.dir}/${jar.name}" |
basedir="${classes.dir}" | basedir="${classes.dir}" | ||
includes="**/*.class" /> | includes="**/*.class" /> | ||
- | </target> | + | </target> |
- | + | ||
<target name="clean" > | <target name="clean" > | ||
<delete dir="${classes.dir}/classes/*" /> | <delete dir="${classes.dir}/classes/*" /> | ||
Line 61: | Line 62: | ||
/> | /> | ||
</pre> | </pre> | ||
+ | |||
+ | * 외부 jar 포함해서 통으로 만들기 (jar merge) | ||
+ | <pre> | ||
+ | <zip destfile="out.jar"> | ||
+ | <zipgroupfileset dir="lib" includes="*.jar"/> | ||
+ | </zip> | ||
+ | </pre> | ||
+ | |||
+ | = Ivy is not available 오류 발생시 = | ||
+ | * http://ant.apache.org/ivy/download.cgi 에서 apache-ivy-2.3.0-rc1-bin-with-deps.tar.gz 파일을 다운 | ||
+ | * 압축해제한 다음, ivy-2.3.0-rc1.jar 파일을 ANT_HOME/lib 파일에 복사 |
Latest revision as of 01:53, 17 May 2012
- Cause: Could not load a dependent class com/jcraft/jsch/LoggerIt is not enough to have Ant's optional JARs 메시지가 나올 경우
- http://www.jcraft.com/jsch/ 에서 jsch-0.1.45.jar 파일을 다운 받고
- D:\eclipse\plugins\org.apache.ant_1.8.2.v20110505-1300\lib 에 복사
- eclipse에서 windows - preference - ant - runtime - ant home에 추가
- scp 관련
- sample xml
<?xml version="1.0"?> <project name="XlosAnt" default="jar" basedir="." > <property name="src.dir" value="${basedir}/src" /> <property name="classes.dir" value="${basedir}/bin" /> <property name="jar.dir" value="${basedir}/dist" /> <property name="jar.name" value="xlos.jar" /> <target name="dist" depends="jar"> <scp file="${jar.dir}/${jar.name}" trust="true" todir="hdfs:****@host:/home/hdfs/users/chaehyun" /> </target> <target name="compile" > <javac srcdir="${src.dir}" destdir="${classes.dir}" /> </target> <target name="jar" depends="compile"> <jar jarfile="${jar.dir}/${jar.name}" basedir="${classes.dir}" includes="**/*.class" /> </target> <target name="clean" > <delete dir="${classes.dir}/classes/*" /> <delete dir="${jar.dir}/jar/*" /> <delete dir="${javadoc.dir}/doc/*" /> </target> </project>
- 특정 디렉토리로 옮기기
<target name="deploy-local" depends="jar"> <move file="${build.dir}/${final.name}.jar" tofile="runtime/local/lib/${final.name}.jar"/> </target>
- library jar 포함하기
<path id="dyna.jars"> <fileset dir="${basedir}/lib"> <include name="**/*.jar"/> </fileset> <fileset dir="${basedir}/lib2"> <include name="**/*.jar"/> </fileset> </path> <target name="compile" > <javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="dyna.jars" />
- 외부 jar 포함해서 통으로 만들기 (jar merge)
<zip destfile="out.jar"> <zipgroupfileset dir="lib" includes="*.jar"/> </zip>
Ivy is not available 오류 발생시
- http://ant.apache.org/ivy/download.cgi 에서 apache-ivy-2.3.0-rc1-bin-with-deps.tar.gz 파일을 다운
- 압축해제한 다음, ivy-2.3.0-rc1.jar 파일을 ANT_HOME/lib 파일에 복사