How to install ant contrib under Windows?

后端 未结 7 474
无人及你
无人及你 2020-12-30 12:49

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

Indeed

相关标签:
7条回答
  • 2020-12-30 13:32

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

    0 讨论(0)
  • 2020-12-30 13:33

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

    0 讨论(0)
  • 2020-12-30 13:33

    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>
    
    0 讨论(0)
  • 2020-12-30 13:40

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

    0 讨论(0)
  • 2020-12-30 13:41

    This should help :

    <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${lib.dir}/ant-contrib-1.0b3/ant-contrib-1.0b3.jar"/>
    
    0 讨论(0)
  • 2020-12-30 13:49

    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?

    0 讨论(0)
提交回复
热议问题