ant

where's the documentation for the "path" task/element in Ant?

I must be missing something obvious here... I found the online documentation for the <property> task, but I can't find it for the <path> task, e.g.: <path id="client.classpath"> <fileset dir="${libDir}"> <include name="*.jar"/> </fileset> </path> Where is <path> documented? ...

where do you put ivysettings.xml?

I'm trying to learn how to use ivy and would like to setup a local repository of the .jar files I've downloaded. Where do you put the ivysettings.xml file? Does it go in the ant library directory? ...

How do I cache configure settings for static libraries that are built using Ant scripts and SCONS?

Currently, we build a group of static libraries prior to building our app. The issue is that for each library there is some variation of the ./configure, make , test sequence. I would like to be able to cache the results of the configure step to speed up the build, since it is common to build on the same platform multiple times. We are t...

What is the proper way to reload your application in Tomcat from Ant without encountering Permgen Exceptions?

My team and I are developing a Java web app using Tomcat as our development testing server and Ant as our build tool. Our platform is Windows but we're running Tomcat out of Cygwin as our preferred shell is bash. We've run into consistent problems with running out of memory due to the frequent restarts of the application in order to ma...

ant machine name property

Is there a way to get the machine name as ant property, for both Linux and Windows OS. ...

How do I find the latest version of an artifact from a maven repository

As part of an automated deployment I need a script to download the latest version of an artifact from our internal repository. Ideally this script will be with ant or a unix shell script. So for example: I have myArtifact.war and it has versions 1.0 , 1.1 and 2.0 - I need the script given the correct group id and artifact id to retrie...

Why is System.console() set if executed with java and unset if executed via ant?

I wrote a little commandline-application in Java and wanted to use the new class java.io.Console for this. I use System.console() to get an instance of this class. This call returns a working console, if I call my application via 'java -jar MyApp.jar' but is unset if I execute the application via the java-task of ant. fork is true and sp...

ANT: How to call target for all build.xml in subdirectories?

How do you call a specific target in all build.xml located in all subdirectories using wildcards (ie not hard coding the subdirectory names)? The below answer is hardcoded. Is there a way to do it without hardcode? Similar to this question: Pass ant target to multiple build.xml files in subdirectories ...

good ivy tutorial for local repository?

Can anyone point me at a good tutorial for making & using a local repository with Ivy? (Please don't point me at the Ivy docs, the tutorials are rather confusing) I need to make a local repository to include .jar files that aren't necessarily available through the public maven repositories. ...

How to undeploy the weblogic application using ant task?

I have to deploy my application in weblogic through ant. what i am doing is: <target name="deployOnServer1" > <echo>*********** Start deploying war file on SERVER1 *********** </echo> <wldeploy action="redeploy" source="${dist.dir}/${ant.project.name}.war" name="${wls.appname}" user="${wls1.user}" ...

Nutch plugin development

The nutch wiki has instructions on how to build nutch plugins, but only if you download the entire nutch source tree and put it in there, below $NUTCH_HOME/src/plugin. I don't want my source code mixed in their subversion tree, I want it in my src/com/xcski git repository. And I shouldn't have to download the source code for nutch just...

another java.lang.ClassNotFoundException in ant's junit task

I can't figure out why I am getting this exception from my ant build.xml file. I checked and everything is in the classpath. Why must this be so complicated?! I had trouble with Ant in the past and it seems it always is something related to the classpath. I am pointing to junit.jar using both ways: within eclipse: window->preferences->a...

creating an executable jar file with ant which includes the build.xml file

Hello, I am trying to use ant to build an application, run the application's main() method, run junit tests, and package everything in a jar file (source+build+libraries+build.xml). The classes include a runner class with a main() method entry point. The objective however is to inlcude all libraries used, like junit.jar, and the ant bu...

adding non-code resources to jar file using Ant

Hello, I am in the process of packaging my java application into a jar file. I am using ant and eclipse. I need to actually include in the jar a couple of separate, non-code files (xml and txt files) directly under the root folder, not in the same place as the code. I am trying to use includesfile, but that doesn't seem to work, here i...

How do I add time-stamp information to Maven artifacts?

I am upgrading a large build-system to use Maven2 instead of Ant, and we have two related requirements that I'm stuck on: We need to generate a time-stamped artifact, so a part of the package phase (or wherever), instead of building project-1.0-SNAPSHOT.jar we should be building project-1.0-20090803125803.jar (where the 2009080...

Mac OS X: Setting up Xcode to use Ant results in permission errors

I'm trying to setup Xcode as my primary IDE to work with our existing projects but running into some permissions problems. Our projects are java based and we use ant to build the jar and it all runs under Tomcat. Up until now, I have been working strictly from the terminal and a text editor. This has been working fine, but I'm trying t...

How can I execute a Perl script using the Ant exec task?

I currently have this in my Ant build script: <exec dir="${basedir}" executable="perl"> <arg line="${basedir}/version.pl -major"/> </exec> However, when that runs, I get this error message: [exec] Could not open -major [exec] Result: 2 To me, that says that what I have is trying to run a file called -major, which doesn't ...

How to <copy> in a <macrodef> in ant?

I'm trying to copy files in a macro, like so: <project name="why" default="go"> <macrodef name="copy-some-stuff"> <attribute name="file.name" /> <copy todir="/var/tmp"> <fileset file="${file.name}" /> </copy> </macrodef> <target name="go"> <copy-some-stuff file.name="/etc/hosts" /> </target> </project> ...

Simple Apache Ant Question: Including library dependencies.

Hey guys, I can't quite figure out how to add all of my .jar dependencies to my client jar. This is what I have so far: <target name="create-metrics-client" depends="clean,build"> <jar destfile="sd-metrics-client.jar" basedir="${build.home}"> <manifest> <attribute name="Main-Class" value="com.mycompany.client.M...

Simulating the Maven2 filter mechanism using Ant

I have a properties file, let say my-file.properties. In addition to that, I have several configuration files for my application where some information must be filled regarding the content of my-file.properties file. my-file.properties: application.version=1.0 application.build=42 user.name=foo user.password=bar Thus, in my configura...