0

On my machine, I have a plugin for Ant. It's called ant-contrib. It was easy to install. I just put the ant-contrib-0.3.jar in the lib folder of Ant. It lets me do some cool things with Ant, including if statements. Now, I want to run my build scripts using Bamboo. Currently the version of Ant that bamboo uses does not have these capabilities so my scripts fail. How do I install plugins like ant-contrib in bamboo?

Sam Backus
  • 1,693
  • 14
  • 19

2 Answers2

2

My recommendation is to commit the ant-contrib jar alongside your source code and make your build more portable by declaring the tasks as follows:

<taskdef resource="net/sf/antcontrib/antcontrib.properties">
  <classpath>
    <pathelement location="${lib.dir}/ant-contrib-0.3.jar"/>
  </classpath>
</taskdef>

Another alternative is to use ivy to manage your build's 3rd party dependencies.

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
1

Copy ant-contrib-version.jar to the lib directory of your Ant installation, or on your CLASSPATH environment variable. If you want to use one of the tasks in your project.

For Ant verssion 1.6 and above, add the lines below in your build.xml file

<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="/home/svnadmin/apache-ant-1.8.4/lib/ant-contrib-version.jar"/>
</classpath>
</taskdef>

For Ant Version 1.5, add the below lines in your build.xml file. Also, you must use the the .properties file instead of antlib.xml

<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="/home/svnadmin/apache-ant-1.5.0/lib/ant-contrib-version.jar"/>
</classpath>
</taskdef>
Shweta Chandrakar
  • 353
  • 2
  • 3
  • 12