Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install ant contrib under Windows?

Tags:

ant

Prelude: Ant-Contrib provides a very well explained wiki page for installation and launch ([http://ant-contrib.sourceforge.net/#install][1]).

Indeed, only two steps is necessary: - build ant-contrib-0.3.jar (by ant dist...), - move the built .jar into the lib directory of your Ant installation,

Use it by writing in your own project:

<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

My problem: I succeeded to build the .jar (build successful is written). But I cannot find any "antcontrib.properties" in the jar built!

Request: What is the important thing I have forgotten? Is it better to search any ant-contrib-0.3.jar already built? Thanks

like image 634
pindare Avatar asked Mar 17 '09 09:03

pindare


People also ask

What is the use of ant-contrib jar?

The Ant-Contrib project is a collection of user supplied task (like an <if> task) and a development playground for experimental tasks like a C/C++ compilation task for different compilers.


6 Answers

if you have teh later 1.0b3 version..
from http://sourceforge.net/projects/ant-contrib/
or http://ant-contrib.sourceforge.net

i beleive you have to use this one for ANT 1.6 and later :

<taskdef resource="net/sf/antcontrib/antlib.xml"/>

instead of the antlib.properties file.

like image 164
ShoeLace Avatar answered Sep 27 '22 22:09

ShoeLace


I made a simple installer called WinAnt that will install Ant and Ant-contrib for you.

like image 39
XZVASFD Avatar answered Sep 27 '22 22:09

XZVASFD


If you download this file http://www.java2s.com/Code/JarDownload/ant-contrib-0.6.jar.zip, there's a antcontrib.properties contained. So maybe the installation instructions or the ant build file is out of date. Have you tried to use Maven for building the Ant-Contrib?

like image 20
Mork0075 Avatar answered Sep 27 '22 22:09

Mork0075


I use my custom in-build.xml installer. This bad boy detects if you have it in your ant lib dir, then downloads and inits it if it's not.

All you need to do is add a depends="init-ant-contrib" to your target, and bam. You have ant-contrib whenever/wherever you deploy -- As long as sourceforge doesn't take away the dl link.

  <!-- ANT-CONTRIB autoinstaller -->
  <available property="ant-contrib-exists"
             file="${ant.library.dir}/ant-contrib-1.0b3.jar" />
  <target name="download-ant-contrib" unless="ant-contrib-exists">
    <mkdir dir="${ant.library.dir}" />
    <get src="http://downloads.sourceforge.net/project/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3-bin.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fant-contrib%2Ffiles%2Fant-contrib%2F1.0b3%2F&amp;use_mirror=cdnetworks-us-1"
         dest="${ant.library.dir}/ant-contrib-1.0b3-bin.zip"
         username="true" />
    <unzip src="${ant.library.dir}/ant-contrib-1.0b3-bin.zip"
           dest="${ant.library.dir}"
           overwrite="no" />
    <move todir="${ant.library.dir}">
      <fileset file="${ant.library.dir}/ant-contrib/*.jar" />
      <fileset file="${ant.library.dir}/ant-contrib/lib/*.jar" />
    </move>
    <delete file="${ant.library.dir}/ant-contrib-1.0b3-bin.zip" />
    <delete dir="${ant.library.dir}/ant-contrib" />
  </target>
  <target name="init-ant-contrib" depends="download-ant-contrib">
    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
      <classpath>
        <pathelement location="${ant.library.dir}/ant-contrib-1.0b3.jar" />
      </classpath>
    </taskdef>
  </target>
like image 24
Nthalk Avatar answered Sep 29 '22 22:09

Nthalk


You need to download ant-contrib-1.0b3 the latest version (1.0b5) does not contain ant-contrib-1.0b3.jar

like image 39
EsotericNonsense Avatar answered Sep 30 '22 22:09

EsotericNonsense


Here's the place you can find binary ant-contrib distributions: http://sourceforge.net/project/showfiles.php?group_id=36177&package_id=28636

like image 45
wheleph Avatar answered Sep 30 '22 22:09

wheleph