Apache ant does not recognize 'for' task/macro, although I have added ant-contrib via taskdef

前端 未结 2 1750
深忆病人
深忆病人 2020-12-30 04:32

I am getting following while doing ant build:

Build\\build.xml:247: Problem: failed to create task or type
for
Cause: The name is undefined.
Action: Check th         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-30 05:08

    If you placed the AntContrib jar in $ANT_HOME/lib directory, all you really need to do is this:

    
    

    Actually to use the task, you need to do this:

    
    

    Note you have to use antlib.xml and not antcontrib.properties. Read the Installation directions very carefully. It's easy to miss.

    If you are doing this in a group project, I recommend that you put your ant-contrib.jar in your project. THen add them to your project in your version control system. That way, other developers can use your build with the ant-contrib tasks without downloading the ant-contrib jar and installing it in their $ANT_HOME directory themselves.

    Let's say you create a directory called ant-contrib.dir and put that in the root of your project, then put the ant-contrib jar in that folder. Just put this in your project:

    
        
              
        
    
    

提交回复
热议问题