{"id":326,"date":"2012-03-14T21:56:21","date_gmt":"2012-03-14T20:56:21","guid":{"rendered":"http:\/\/blog.ansuz.nl\/?p=326"},"modified":"2012-03-14T21:56:21","modified_gmt":"2012-03-14T20:56:21","slug":"ant-contrib-for-loop-error-2","status":"publish","type":"post","link":"http:\/\/blog.ansuz.nl\/index.php\/2012\/03\/14\/ant-contrib-for-loop-error-2\/","title":{"rendered":"Ant-Contrib for loop error"},"content":{"rendered":"<p>When trying to use <a href=\"http:\/\/ant-contrib.sourceforge.net\/tasks\/tasks\/for.html\" target=\"_blank\">Ant-Contrib for loops<\/a> today, I ran into the error below:<\/p>\n<blockquote><p>BUILD FAILED<br \/>\nC:\\Projects\\&#8230;\\ant\\build.xml:200: Problem: failed to create task or type for<br \/>\nCause: The name is undefined.<br \/>\nAction: Check the spelling.<br \/>\nAction: Check that any custom tasks\/types have been declared.<br \/>\nAction: Check that any &lt;presetdef&gt;\/&lt;macrodef&gt; declarations have taken place.<\/p><\/blockquote>\n<p>To fix the error I had to update the Ant-Contrib taskdef resource path from using &#8220;antcontrib.properties&#8221; to use &#8220;antlib.xml&#8221; in my Ant build file.<\/p>\n<div id=\"ig-sh-1\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">code<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"code\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">\/\/ Remove this line<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&lt;taskdef resource=&quot;net\/sf\/antcontrib\/antcontrib.properties&gt;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">\/\/ And replace with this one<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&lt;taskdef resource=&quot;net\/sf\/antcontrib\/antlib.xml&quot;&gt;<\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>According to the <a href=\"http:\/\/ant-contrib.sourceforge.net\/\" target=\"_blank\">Ant-Contrib<\/a> manual (found in [Ant-Contrib install dir]\/docs\/manual\/index.html) you need to use the &#8220;antcontrib.properties&#8221; file when you want <a href=\"http:\/\/ant-contrib.sourceforge.net\/\" target=\"_blank\">Ant-Contrib<\/a> to run with Ant Version 1.5. They even place a warning saying:<\/p>\n<blockquote><p>Keep in mind that some tasks will not be available to you , such as the &lt;for&gt; task<\/p><\/blockquote>\n<p>The confusing part is that on the <a href=\"http:\/\/ant-contrib.sourceforge.net\/#install\" target=\"_blank\">project page<\/a> they tell you to use the &#8220;antcontrib.properties&#8221; file.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>When trying to use Ant-Contrib for loops today, I ran into the error below: BUILD FAILED C:\\Projects\\&#8230;\\ant\\build.xml:200: Problem: failed to create task or type for Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks\/types &hellip; <a href=\"http:\/\/blog.ansuz.nl\/index.php\/2012\/03\/14\/ant-contrib-for-loop-error-2\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[94,96,95],"class_list":["post-326","post","type-post","status-publish","format-standard","hentry","category-random","tag-ant","tag-ant-contrib","tag-contrib"],"_links":{"self":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/comments?post=326"}],"version-history":[{"count":6,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/326\/revisions"}],"predecessor-version":[{"id":332,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/326\/revisions\/332"}],"wp:attachment":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/media?parent=326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/categories?post=326"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/tags?post=326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}