cuiyi's blog(崔毅 crazycy)

          記錄點(diǎn)滴 鑒往事之得失 以資于發(fā)展
          數(shù)據(jù)加載中……

          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技術(shù)

          主站蜘蛛池模板: 永兴县| 宜州市| 扎兰屯市| 新河县| 蓬溪县| 武邑县| 自贡市| 永宁县| 平潭县| 会宁县| 宝应县| 临安市| 孝昌县| 云梦县| 绩溪县| 天长市| 津南区| 西青区| 轮台县| 东安县| 榆树市| 吐鲁番市| 玉门市| 田林县| 扎鲁特旗| 迭部县| 天台县| 牙克石市| 东台市| 洞口县| 华池县| 铁岭县| 綦江县| 普洱| 萍乡市| 乐平市| 宜阳县| 宜都市| 南昌市| 天台县| 锦州市|