ant

Prevent Ant to perform a task if a file is older than an other file

Hi all, how can I prevent Ant to process a task if a source file is older than the current target. For example, I created a javacc file MyParser.jj and there is no need for javacc to re-generate the file MyParser.java as long as the MyParser.jj is older than MyParser.java. Thanks ...

need help with java applet which uses external jar ojdbc6.jar

I have wrote a java applet which is pretty simple. It connects to a oracle database upon clicking a button. It works fine, it connects when I run it using eclipse. However, when I use ant to create the jar file I dont know how to include the ojdbc6.jar as a classpath. Can someone please help me? Ive been trying for a week now. Here is ...

Java Ant: How to setup "apply" task with allowing file overwriting?

My command line app call looks like this: java -jar myapp.jar --output c:\test.txt c:\test.txt Which reads test.txt, processes it and saves result to the same file. I am trying to make ant task out of it but can't figure out how to make it use same path for input and output. <target name="compress"> <apply executable="ja...

How to redirect stdout stderr in an ant script?

Hi, I am triggering an ant script (via cruise control), and would like to be able to dump the std out and std err for a particular ant target to a plain text file. Yes, I am aware that cruise control already does maintain an XML log file containing this information (among many other things), but for portability reasons, I need this to ...

Can't access property generated by a script in an imported ANT target.

What I'm trying to do is compile to a file which takes it's version from a constant inside my source files. I have a setup like this (or at least the significant bits): tasks/compile.xml <project name="Compile"> <target name="check.version"> <script language="javascript"> regex = /VERSION.+?"([\d\.]+)";/; ...

Can Eclipse not hard-code ECLIPSE_HOME when exporting build.xml?

I have an Eclipse project that I'm attempting to set up to build both with Eclipse and externally with Ant. It seems like a good way to do this is to have Eclipse generate a build.xml file that I can then use with ant. I'd like to set it up so the build.xml can be regenerated from Eclipse whenever the need arises, which means no hand-e...

How to create a tar file from a jar file, Netbeans, ant

Hi I have netbeans 6.7.1. My build.xml file creates a jar file. Now I want both jar and tar file. my tar file must be created from my jar file. SO how to create tar file from my jar file by making some changes in build.xml. I think it uses ant to create jar file. Thanks Sunil Kumar Sahoo ...

Custom JUnit Report?

I am using the ant tasks 'junit' and 'junitreport' to run my JUnit Tests and generate a report at the end (=> "Unit Test Results"). Is it there some easy way to extend this output somehow to get more information displayed in the report? For example to add an additional column which contains link to a screenshot taken by the test. I've ...

Cruisecontrol is having trouble parsing a line that ant is just fine with

I'm having trouble getting my cruisecontrol script to do something. I want to call grep on the files in my project to search for a few preprocessor defines, and place them into a list, which I can use later. This snippet works fine when I toss it into an ant buildfile, but returns an error when used in cruisecontrol... <target name="gen...

java ant buildfile for project with dependencies

I am new to ant, but am trying to create an ant script that builds my current proeject with another project as a dependency. I have the ant script building my current project, but am unsure how to add the other project to the classpath. Neither project get put into jar files at the moment. My current portion of the build.xml file is <t...

ant common targets are not recognized by eclipse

Hi All, I have added all common targets like (init,clean,getivy etc) in ./common/common.xml and added import file="${basedir}/common/common.xml" in build.xml. When i build the project, its working fine.But, When i open build.xml in eclipse IDE , i see some "Red" marks underneath "targets" which has a dependency targets that are defined...

Reading XML file prepared for JAR when testing application in Eclipse

I'm writing a small app with the help of Eclipse while learning Swing GUIs in Java. I'm also taking my first baby steps in Ant build scripting and have come across a small problem. I'm parsing an XML file to create objects to store in a List. I've assigned the Ant build script to include the XML file in the Jar package by adding this to...

How do I properly fix deploy permission issues with Hudson and ant?

I'm having trouble deploying my Web start to the web server due to permissions problems (reformatted): /home/hudson/.../build/build-web-start.xml:20: Failed to copy /home/hudson/.../dist/app.jnlp to /var/development/.../webstart/app.jnlp due to java.io.FileNotFoundException /var/development/.../webstart/app.jnlp (Permission denied) an...

AntClassLoader cannot be cast to URLClassLoader

I have an Ant task to compile jsp files with Jasper. The first step is generate the java files: <java classname="org.apache.jasper.JspC" fork="no" failonerror="true"> <classpath refid="my.class.path" /> <arg value="-uriroot" /> <arg value="${apps}" /> <arg value="-d" /> <arg value="${jsp}" /> <arg value="-p" /> ...

Subant targets instead of ant

Hi everybody! I 'm having a problem with subant and have no ideas any more. Can anyone help? SOS Using ant to replace some strings for other (i.e Productname and Version for "Foo" and "1.2") i used such thing: (copy todir="${Foo_Home}\cm_builds\Deployment\Database\Production.win\"> (fileset dir="${Foo_Home}\Deployment\Database\Producti...

Getting all Maven artifacts from Hudson

I have a Maven project that is a child project. It has many sibling projects and the job of this project is to get resources from the siblings and package them in a zip file using the antrun plugin. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://...

Group and counting a String in Ant

I have the following problem. I have something like 300 Eclipse Plugins. Now, as part of an ant script I want to read all MANIFEST.MF files and then look for the execution environment string. Bundle-RequiredExecutionEnvironment: J2SE-1.4 Now, this string has several possible values. I want to create a report that lists the execution...

how to specify set of files to be copied in lib while creating war

This is my build target <target name="build-war" depends="build-java"> <war destfile="${dist.dir}/${std.war.file}" webxml="${resources.dir}/WEB-INF/web.xml"> <fileset dir="${jsp.dir}" /> <lib dir="${lib.dir}"/> <classes dir="${build.classes.dir}" /> </war> </target> Here for <lib> ca...

How to run Ant inside Visual Studio 2008?

I'm wondering if anyone out there has any ideas about how to run Ant inside Visual Studio 2008. I'm looking to perform some pretty common Ant tasks such as selecting a target to run inside a build file. I have come across and am aware of NANT as well as MSBUILD as more preferred build tools for ASP.NET projects, but I am only intereste...

How to include a file in ivy.xml?

I have a fairly large ivy.xml containing a number of configurations which are the same for a number of projects. I would like to break out this large repetitive section in to a common include file. Somehow I can't find any documentation describing that this can be done. Anyone who has an idea whether this is doable? EDIT: After some f...