ant

ant filtering - fail if property not set

I've got a ant build.xml that uses the <copy> task to copy a variety of xml files. It uses filtering to merge in properties from a build.properties file. Each environment (dev, stage, prod) has a different build.properties that stores configuration for that environment. Sometimes we add new properties to the Spring XML or other config...

Ant replace multiple lines of text

I have an xml file where I need to comment out a whole piece of text with Ant. There's this ant task <replace file="${src.dir}/Version.as" token="@revisionPrana" value="${revision}"/> that I use to replace words, but in my case I need to replace a whole block like this: <value> <object class="edumatic.backoffice.view...

What is the best way to precompile JSPs using ANT

I am trying to figure out the best way to use ANT to precompile JSPs that will be deployed to an Oracle application server. Even though I am deploying to an Oracle app server I would like to avoid using Oracle's version of ANT. ...

Has anyone used or written an Ant task to compile (Rhino) JavaScript to Java bytecode?

I'd like to use the Rhino JavaScript compiler to compile some JavaScript to .class bytecode files for use in a project. It seems like this should already exist, since there are groovyc, netrexxc, and jythonc tasks for Groovy, NetREXX(!) and Jython, respectively. Has anyone used or written such an Ant task, or can anyone provide some tips...

Why does Apache return a 503 error for ant's get task, but not for my browser?

I'm trying to get a file with ant, using the get property. I'm running apache 2, and I can get the file from the indicated URL using wget and firefox, but ant gives me the following error: [get] Error opening connection java.io.IOException: Server returned HTTP response code: 503 for URL: http://localhost/jars/jai_core.jar This is wh...

ANT: Override the compiler attribute in an Ant javac task

I'm trying to override ant's compiler attribute via the command line so that all javac tasks occur using my specified compiler. The problem I've run into is that any target that sets its own value for compiler overrides the one that I set at the commmand line. So, even though I'm entering the following command. ant -Dbuild.compile...

What are the custom targets you all run when using ant to build project?

I am thinking of running this custom targets to find out more about my project build status - jalopy - jdepend - cvs tagdiff report - custom task for NoUnit - generate UML diagram. ESS-Model What are your views? ...

Missing ant-javamail.jar file on Macintosh

I've been running the built-in Ant from the command line on a Macintosh (10.5.5) and have run into some trouble with the Mail task. Running the Mail task produces the following message: [mail] Failed to initialise MIME mail: org.apache.tools.ant.taskdefs.email.MimeMailer This is most likely due to a missing ant-javamail.jar file in th...

How to use ant with EditPad in Windows?

Does anyone know how to use ANT as a EditPad (Windows)? I know i can use a external tool using Configure Tools in the Tools menu but do not know how to configure ANT. ...

What's, in your opinion, the best ANT front-end GUI?

Tell me what you think... Would be nice if it's free... ...

Web app for running ant task

Does anyone know of a simple web app that supports running ant tasks? Alternatively it could run command line programs. I need to allow the user to choose parameters for running the ant task. I effectively want a web interface to run the ant task and provide any parameters. I can write one but this is generic enough that it seems lik...

javac error "code too large"??

I have a unit test where I have statically defined a quite large byte array (over 8000 bytes) as the byte data of a file I don't want to read every time I run my unit test. private static final byte[] FILE_DATA = new byte[] { 12,-2,123,................ } This compiles fine within Eclipse, but when compiling via Ant script I get the fo...

How do I make svnant/svnkit prompt for a username/password

I have an Ant script that needs to checkout a directory from Subversion. This works using svnant/svnkit. However, Subversion access is authenticated, and I do not want to store my user password in a file. Can I make svnkit pop up a password dialog? Or even better, make it use the same credential caching that subversive/svnkit inside of...

How can I convert a DTD to a Schema as part of a Maven or ANT build?

How can I convert a DTD to a Schema as part of a Maven build? Specifically, I am looking for a Maven plugin to which I can give the URL to a DTD and it will generate an XML Schema Definition file. Failing a good Maven plugin, perhaps I can embed an ANT task into my Maven build ...

How get a list of files under a subversion-url in ant?

I want with ant access a subversion-repository and get a list of files available under a specific svn-url like https://svn.myhost.de/repository/path/into/repo. I want to list all items, subdirectories or files, in some form I can work with later in the ant-file. A comma-separated list is fine, it can be input for the foreach-task of ant-...

How to set the working directory for a <junit> task to something other than the basedir?

I have an Ant script with a junit target where I want it to start up the VM with a different working directory than the basedir. How would I do this? Here's a pseudo version of my target. <target name="buildWithClassFiles"> <mkdir dir="${basedir}/UnitTest/junit-reports"/> <junit fork="true" printsummary="yes"> <classpath> <pathe...

EMMA coverage tool not displaying line-by-line coverage

I am using the EMMA tool for code coverage yet despite my best efforts, EMMA is refusing to see the original .java files and generate coverage on a line-by-line basis. We are using ANT to build the code and debug is set to true. I know that EMMA is measuring coverage as the .emma files seem to be generating and merging correctly. The re...

Ant build that finds applications and iterates across them.

I use Ant to build Delphi applications (called from CruiseControl). I want ant to recursively search through a directory tree looking for files *.dpr and when found call either a second build.xml, or preferable a macro or target, passing each of the found file names as a 'parameter'. I have found that I can use subant to find build.xml...

How to specify a relative path for the jsUnit-ant-script?

JsUnit provides an ant-script with the target 'standalone_test'. This target uses the property url to identify the HTML-site, that executes the tests. These site is checked in, so that everyone should be able after a checkout to execute this tests. This works, but the url-proprty must be set to an absolute path, like file:///home/user/pr...

How to store Apache Ant property value in file

I need to modify a (xml-)file from Apache Ant. "loadfile" task allows to load the file's content in a property. But how to store the property's value back to a file after its (property) modification? Of course I could write custom task to perform this operation but I would like to know if there's some existing implementation. ...