【问题标题】:Apache Ant - Intellij Idea Community don't recognize for loop commandApache Ant - Intellij Idea 社区无法识别 for loop 命令
【发布时间】:2016-03-14 12:52:52
【问题描述】:

我想创建一个 for 循环来遍历文件的行。 我做到了:

<loadfile property="download.file" srcfile="download_list.txt"/>

<target name="criarArvore">
    <mkdir dir="${download.dir}"/>
    <mkdir dir="${domain.dir}"/>
</target>

<target name="download" depends="criarArvore">
    <for param="line" list="${download.file}" delimiter="${line.separator}">
        <sequential>
            <echo>@{line}</echo>
        </sequential>
    </for>
</target>

但在&lt;for&gt; intellij 警告我:'无法解析符号“for”'。 当我运行我收到的脚本时:

c:\xxx\build.xml:22: Problem: failed to create task or type for
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.

【问题讨论】:

    标签: intellij-idea ant ant-contrib


    【解决方案1】:

    &lt;for&gt; task 来自第三方Ant-Contrib library

    要使用 Ant-Contrib,请下载 ant-contrib-1.0b3-bin.zip,从中提取 ant-contrib-1.0b3.jar,然后按照 how to install Ant-Contrib 上的说明进行操作。

    【讨论】:

    • 我无法正确安装 ant-contrib。我按照您传递的安装链接和官方安装指南:ant-contrib.sourceforge.net 以及我在互联网上找到的其他指南,但无法使其正常工作。它似乎已经过时了,因为它的日期是 2002 - 2003 年。
    • 现在我明白了!我跟进了 zip 文件中包含的安装手册。似乎 intellij 不认识它,但任务有效。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-05
    • 2019-04-27
    • 2022-10-04
    • 1970-01-01
    相关资源
    最近更新 更多