<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ant Archives - StandarTux</title>
	<atom:link href="https://standartux.fr/tag/ant/feed/" rel="self" type="application/rss+xml" />
	<link>https://standartux.fr/tag/ant/</link>
	<description>Site sur les logiciels libres, l&#039;open source et GNU/Linux</description>
	<lastBuildDate>Mon, 08 Mar 2010 10:00:00 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://standartux.fr/wp-content/uploads/2019/09/favicon.gif</url>
	<title>Ant Archives - StandarTux</title>
	<link>https://standartux.fr/tag/ant/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>ant &#8211; Could not create task or type of type: for.</title>
		<link>https://standartux.fr/ant-could-not-create-task-or-type-of-type-for/</link>
					<comments>https://standartux.fr/ant-could-not-create-task-or-type-of-type-for/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 08 Mar 2010 10:00:00 +0000</pubDate>
				<category><![CDATA[Trucs et astuces]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[astuces]]></category>
		<category><![CDATA[java]]></category>
		<guid isPermaLink="false">https://standartux.fr/?p=821</guid>

					<description><![CDATA[<p>Si vous avez l&#8217;erreur Could not create task or type of type: for. lors de l&#8217;utilisation de Ant sous eclipse, voici un moyen de resoudre ce problème. Ant could not find the task or a class this task relies upon. This is common and has a number of causes; the usual solutions are to read <a class="read-more" href="https://standartux.fr/ant-could-not-create-task-or-type-of-type-for/">[&#8230;]</a></p>
<p>L’article <a href="https://standartux.fr/ant-could-not-create-task-or-type-of-type-for/">ant &#8211; Could not create task or type of type: for.</a> est apparu en premier sur <a href="https://standartux.fr">StandarTux</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" src="/public/icones/paper-bug-report.png" alt="bug" style="display:block; margin:0 auto;" /></p>
<p>Si vous avez l&rsquo;erreur <code>Could not create task or type of type: for.</code> lors de l&rsquo;utilisation de Ant sous eclipse, voici un moyen de resoudre ce problème.</p>
<blockquote>
<p>Ant could not find the task or a class this task relies upon.</p>
<p> This is common and has a number of causes; the usual solutions are to read the manual pages then download and install needed JAR files, or fix the build file: &#8211; You have misspelt &lsquo;for&rsquo;. Fix: check your spelling. &#8211; The task needs an external JAR file to execute and this is not found at the right place in the classpath. Fix: check the documentation for dependencies. Fix: declare the task. &#8211; The task is an Ant optional task and the JAR file and/or libraries implementing the functionality were not found at the time you yourself built your installation of Ant from the Ant sources. Fix: Look in the ANT_HOME/lib for the &lsquo;ant-&lsquo; JAR corresponding to the task and make sure it contains more than merely a META-INF/MANIFEST.MF. If all it contains is the manifest, then rebuild Ant with the needed libraries present in ${ant.home}/lib/optional/ , or alternatively, download a pre-built release version from apache.org &#8211; The build file was written for a later version of Ant Fix: upgrade to at least the latest release version of Ant &#8211; The task is not an Ant core or optional task and needs to be declared using &lt;taskdef&gt;. &#8211; You are attempting to use a task defined using &lt;presetdef&gt; or &lt;macrodef&gt; but have spelt wrong or not defined it at the point of use</p>
<p> Remember that for JAR files to be visible to Ant tasks implemented in ANT_HOME/lib, the files must be in the same directory or on the classpath</p>
<p> Please neither file bug reports on this problem, nor email the Ant mailing lists, until all of these causes have been explored, as this is not an Ant bug.</p>
</p>
</blockquote>
<p>Déjà, vérifiez que Ant est bien installé et dans quelle version :<br />
dans une console, entrez&nbsp;: </p>
<pre> $ ant -version<br /></pre>
<p>ceci devrait vous renvoyer un résultat du type:</p>
<pre> Apache Ant version 1.6.5 compiled on June 2 2005<br /></pre>
<p>de même, allez consulter vos variables d&rsquo;environnement pour le Home directory de Ant avec la commande&nbsp;: </p>
<pre> $ set<br /></pre>
<p>vous devriez trouver une ligne du type:</p>
<blockquote>
<p>ANT_HOME=/usr/share/ant</p>
</blockquote>
<p>Ensuite, il faut savoir que le support de la « boucle for » n&rsquo;est pas incluse par défaut dans ant, mais que cette dernière est accessible par l&rsquo;ajout d&rsquo;une librairie complémentaire nommée ant-contrib.</p>
<p>Pour l&rsquo;installer, aller sous votre gestionnaire de paquets et recherchez le mot &lsquo;ant-contrib&rsquo;, soit utilisez votre terminal en mode root et tapez (pour fedora) :</p>
<pre> # yum install ant-contrib<br /></pre>
<p>Une fois les nouveaux paquets telechargés, allez les associer aux &lsquo;entries Ant&rsquo; d&rsquo;eclipse. Donc sous eclipse, allez dans le menu Window-&gt;Preferences.<br />
Ouvrez la catégorie &lsquo;Ant&rsquo; et selectionnez le sous menu &lsquo;Runtime&rsquo;. Là, dans l&rsquo;onglet &lsquo;Classpath&rsquo;, selectionner votre &lsquo;Ant Home entries&rsquo; qui indique le chemin de Ant (peut être /usr/share/ant suivant où il est installé sous votre système).</p>
<p>Si vous developpez le menu, vous verrez toutes les librairies utilisées par Ant. A partir de là, appuyer sur le bouton &lsquo;Add external jar&rsquo; et ajoutez le fichier &lsquo;ant-contrib.jar&rsquo; à cette liste. validez.</p>
<p><a href="/public/Ant/Ant_Preferences.png" hreflang="" rel="lightbox[Ant]" title="Preferences Ant"><img decoding="async" src="/public/Ant/.Ant_Preferences_s.jpg" alt="Preferences Ant" style="display:block; margin:0 auto;" /></a></p>
<p>A présent, dans le fichier build.xml du projet. Ajoutez juste ces quelques lignes au début de votre fichier :</p>
<pre> &lt;taskdef resource="net/sf/antcontrib/antlib.xml"&gt;<br />
	&lt;classpath&gt;<br />
		&lt;pathelement location="${ANT_HOME}/lib/ant-contrib.jar"/&gt;<br />
	&lt;/classpath&gt;<br />
  &lt;/taskdef&gt;<br /></pre>
<p>Relancez le &lsquo;Ant Build&rsquo; de votre projet et ça devrait marcher.</p>
<p>L’article <a href="https://standartux.fr/ant-could-not-create-task-or-type-of-type-for/">ant &#8211; Could not create task or type of type: for.</a> est apparu en premier sur <a href="https://standartux.fr">StandarTux</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://standartux.fr/ant-could-not-create-task-or-type-of-type-for/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Mise en cache de page à l’aide de Disk: Enhanced (SSL caching disabled) 
Content Delivery Network via www.standartux.fr

Served from: standartux.fr @ 2026-04-19 10:36:05 by W3 Total Cache
-->