ant

How do you create a MANIFEST.MF that's available when you're testing and running from a jar in production?

I've spent far too much time trying to figure this out. This should be the simplest thing and everyone who distributes Java applications in jars must have to deal with it. I just want to know the proper way to add versioning to my Java app so that I can access the version information when I'm testing, e.g. debugging in Eclipse and runn...

Ant OS-specific copy task

I have an Ant script that performs a copy operation using the copy task. It was written for Windows and has a hardcoded C:\ path as the todir argument. I see the exec task has an OS argument, is there a similar way to branch a copy based on OS? ...

Files not extracted from .jar file when run

I have updated my ant build.xml file to include a new file and a new folder. After creating the .jar I check if they exist in the jar by 'unzip\extract', and they are there. But when executing the .jar neither the folder or the file gets extracted. Am I missing a step? ...

Eclipse 3.3.2/MyEclipse doesn't recognize xml as ant files

Using eclipse 3.3.2 with MyEclipse installed. For some reason if a file isn't called build.xml then it isnt' recognised as an ant file. The file association for *.xml includes ant and says "locked by 'Ant Buildfile' content type. The run-as menu is broken. Even if the editor association works run-as doesn't. The ant buildfiles in quest...

Automated Unit Testing with JavaScript

I'm trying to incorporate some JavaScript unit testing into my automated build process. Currently JSUnit works well with JUnit, but it seems to be abandonware and lacks good support for AJAX, debugging, and timeouts. Has anyone had any luck automating (with ANT) a unit testing library such as YUI test, JQuery's QUnit, or jQUnit (http...

Ant Junit tests are running much slower via ant than via IDE - what to look at?

I am running my junit tests via ant and they are running substantially slower than via the IDE. My ant call is: <junit fork="yes" forkmode="once" printsummary="off"> <classpath refid="test.classpath"/> <formatter type="brief" usefile="false"/> <batchtest todir="${test.results.dir}/xml"> <formatter...

Unconditionally execute a task in ant?

I'm trying to define a task that emits (using echo) a message when a target completes execution, regardless of whether that target was successful or not. Specifically, the target executes a task to run some unit tests, and I want to emit a message indicating where the results are available: <target name="mytarget"> <testng outputDir...

Performing math functions within ant ReplaceRegExp

I need to increment a number in a source file from an ant build script. I can use the ReplaceRegExp task to find the number I want to increment, but how do I then increment that number within the replace attribute? Heres what I've got so far: <replaceregexp file="${basedir}/src/path/to/MyFile.java" match="MY_PROPERTY = ([0-9]{1,});...

Ant and the available task - what if something is not available?

When I use the task, the property is only set to TRUE if the resource (say file) is available. If not, the property is undefined. When I print the value of the property, it gives true if the resource was available, but otherwise just prints the property name. Is there a way to set the property to some value if the resource is not avai...

Can i update a signed jar using an ANT Task?

Hi I am trying to deploy an application using webstart. I have a requirement to update a jar which is signed before i actually deploy( basically to update the IP/Port info). I am trying to use ANT to update the jar. Is there are way to achive this? Thanks in advance for any help/suggestions ...

Is there a NAnt task that will display all property name / values?

Is there a NAnt task that will echo out all property names and values that are currently set during a build? Something equivalent to ant's echoproperties task maybe. ...

Tips for speeding up build time on Linux using ANT, Javacc, JUnit and compiling Java classes

We have a large codebase that takes approx 12 minutes on the developer machines to auto-generate some Java 5 classes using JavaCC and then compiles all the classes as well as running the units test. The project consists of multiple projects which can be built in groups, but we are aiming for a full a build in under 10 minutes What tips...

When using ANT, how can I define a task only if I have some specific java version ?

I have the problem that an specific step in Ant can only be executed when we have Java 1.5 installed in the build computer. The task definition uses uses a jar file that was compiled using 1.5, so running with a 1.4 virtual machine will throw an IncompatibleClassVersion exception. I have to find a solution meanwhile to have this task ...

Customizing AntRunner output

I'm using Eclipse's AntRunner to build a set of plugins, but I'm having trouble in configuring the logging behavior. Specifically, I'd like AntRunner not to display empty tasks. Anybody knows how to do this? ...

Is there any website which showcase nice / comprehensive build.xml?

What i mean exactly is that build.xml that actually included those plugins like findbugs etc. Or nicely done build.xml ...

How do I delete a dirset of directories with Ant?

I want to delete all directories and subdirectories under a root directory that are contain "tmp" in their names. This should include any .svn files too. My first guess is to use <delete> <dirset dir="${root}"> <include name="**/*tmp*" /> </dirset> </delete> This does not seem to work as you can't nest a dirset in a...

How would you implement ant-style patternsets in python to select groups of files?

Ant has a nice way to select groups of files, most handily using ** to indicate a directory tree. E.g. **/CVS/* # All files immediately under a CVS directory. mydir/mysubdir/** # All files recursively under mysubdir More examples can be seen here: http://ant.apache.org/manual/dirtasks.html How would you implement this i...

How to merge jsp pre-compiled web.xml fragment with main web.xml using Ant

We have the usual web.xml for our web application which includes some jsp and jsp tag files. I want to switch to using pre-compiled jsp's. I have the pre-compilation happening in the build ok, and it generates the web.xml fragment and now I want to merge the fragment into the main web.xml. Is there an include type directive for web.xm...

Why do Jars get Excluded from Enunciate's Deployment?

I'm using Enunciate to build a prototype REST api and need to include a jar containing custom code as a library. My Ant Script looks like this: <!--include all jars--> <path id="en.classpath"> <fileset dir="${lib}"> <include name="**/*.jar" /> </fileset> </path> <!--define the task--> <taskdef name="enunciate" classn...

How to get access to the Websphere 6.1 ant tasks from vanilla ant (not ws_ant)

I guess I need to know what I need in the classpath (what jar) in order to execute WebSphere 6.1 ant tasks. If someone can provide an example that would be perfect. ...