| 664 | * 由於每次都要 compile code, 更新 jar 檔(用 jar uf),所以乾脆查了一下怎麼用 ant 作 jar 的更新。 |
| 665 | * [參考] http://ant.apache.org/manual/Tasks/jar.html |
| 666 | * 修改 http://hadoop.nchc.org.tw/~jazz/build.xml 如下: |
| 667 | {{{ |
| 668 | #!diff |
| 669 | --- build.xml.org 2012-07-21 10:47:32.892275874 +0800 |
| 670 | +++ build.xml 2012-07-21 10:48:34.896278868 +0800 |
| 671 | @@ -2,8 +2,8 @@ |
| 672 | <property name="bindir" value="${basedir}/bin" /> |
| 673 | <property name="docdir" value="${basedir}/doc" /> |
| 674 | <property name="srcdir" value="${basedir}/src" /> |
| 675 | - <property name="jarname" value="${basedir}/output.jar" /> |
| 676 | - <property name="hadoop-home" value="/usr/lib/hadoop" /> |
| 677 | + <property name="jarname" value="${hadoop-home}/hadoop-core-1.0.3.jar" /> |
| 678 | + <property name="hadoop-home" value="c:/hadoop4win/opt/hadoop" /> |
| 679 | <property name="hadoop-libs" value="${hadoop-home}/lib" /> |
| 680 | <property name="hadoop-contrib" value="${hadoop-home}/contrib" /> |
| 681 | |
| 682 | @@ -38,7 +38,7 @@ |
| 683 | </target> |
| 684 | |
| 685 | <target name="jar" depends="compile,doc" description="Package the classes into a .jar file"> |
| 686 | - <jar destfile="${jarname}" basedir="${bindir}" /> |
| 687 | + <jar update="true" destfile="${jarname}" basedir="${bindir}" /> |
| 688 | </target> |
| 689 | |
| 690 | <target name="clean" description="Remove all compilation products to ensure a clean build"> |
| 691 | }}} |
| 692 | * 查詢是否更新 |
| 693 | {{{ |
| 694 | ~$ jar tvfm $(cygpath -w /opt/hadoop/hadoop-core-1.0.3.jar) . | grep FileUtil |
| 695 | }}} |