cuiyi's blog(崔毅 crazycy)

          記錄點滴 鑒往事之得失 以資于發展
          數據加載中……

          ant: failed to create task or type if


           <target name="compile-cxcdata-dao">
              <if>
                <equals arg1="${dummyDAO}" arg2="true" />
                <then>
                  <ant antfile="${data.dir}/data_build.xml" target="compile-data" />
                  <mkdir dir="${apps.jar.dir}" />
                  <jar jarfile="${apps.jar.dir}/data.jar">
                    <fileset dir="${data.classes.dir}" includes="**/*" />
                  </jar>
                </then>
                <else>
                  <copy todir="${apps.jar.dir}" overwrite="true">
                    <fileset dir="${data.dir}" includes="**/*.jar" />
                  </copy>
                </else>
              </if>
            </target>

          BUILD FAILED
          D:\__workspace_svn\apps\build.xml:18: The following error occurred while executing this line:
          D:\__workspace_svn\apps\apps_build.xml:145: The following error occurred while executing this line:
          D:\__workspace_svn\apps\apps_build.xml:100: The following error occurred while executing this line:
          D:\__workspace_svn\apps\apps_build.xml:71: Problem: failed to create task or type if
          Cause: The name is undefined.
          Action: Check the spelling.
          Action: Check that any custom tasks/types have been declared.
          Action: Check that any <presetdef>/<macrodef> declarations have taken place.

          Solution:
          It is a compatibility issue.
          1. 
          Right click on build.xml.

          2.
          Go to "Run As" --> 2 Ant Select Classpath tab check Ant Home version (Sometimes eclipse selects default ant version).
          If the version listed is different, then change Ant Home Classpath to C:\XXXX\ant\X.X.X.

          3.
          Finally click on the Classpath tab --> Add External JARS..--> add ant-contrib.x.x.jar from C:\XXXX\ant\X.X.X\ant-contrib\ directory.

          posted on 2014-03-12 11:03 crazycy 閱讀(2678) 評論(0)  編輯  收藏 所屬分類: JavaEE技術

          主站蜘蛛池模板: 邵武市| 通河县| 大港区| 大邑县| 西乌珠穆沁旗| 朝阳县| 家居| 玉林市| 万宁市| 河池市| 浪卡子县| 冀州市| 信丰县| 华蓥市| 柳江县| 龙川县| 兰州市| 沧源| 平乡县| 霍城县| 尼勒克县| 宕昌县| 隆回县| 平原县| 阿合奇县| 稻城县| 界首市| 昌宁县| 南乐县| 镇巴县| 日喀则市| 铜陵市| 五台县| 仙游县| 新平| 河北区| 上高县| 潍坊市| 来凤县| 宜川县| 舟曲县|