ant

Ant can't find Javac. No matter what I do it always claims JAVA_HOME is "C:\Program Files\Java\jre6"

...and that's wrong. Here's the error I get: BUILD FAILED C:_TraderPlatform\Clients\Open\Open\Java\Applets\PPDataTransporter\nbproject\build-impl.xml:338: The following error occurred while executing this line: C:_TraderPlatform\Clients\Open\Open\Java\Applets\PPDataTransporter\nbproject\build-impl.xml:158: Unable to find a javac compil...

How can I get the revision number into an Ant property in Luntbuild?

I'm sure this must be possible: I want to have the revision number (from Subversion) put into a property that is accessible from Ant when my build runs in Luntbuild. There must be an OGNL expression that I can add to the Build Properties box on the configuration page for my Ant builder. Does anyone know what it is? ...

How to mark some code that must be removed before production?

Sometimes for testing/developing purposes we make some changes in the code that must be removed in a production build. I wonder if there is an easy way of marking such blocks so that production build would fail as long as they are present or at least it will warn you during the build somehow. Simple "//TODO:" doesn't really work because...

Building Freemarker from source

Hey Everyone, I am working on a security project at my university for open source software. I am trying to build freemarker from source, but I am running into some problems. Everything that I can find online says that simple running 'ant' in the root directory should build the project. The only requirement is that you have ant v1.7.0 in...

ANT Script handling Return value from exec

So this is the scenario. I have <target name="test"> <property file="blah"></property> <exec dir="" executable="trast.exe" resolveexecutable="true" spawn="true"> </exec> </target> <!-- So now I have the second target that uses Return value from first target --> <target name="test2"> <property file="blah"></property> <ex...

How to use wildcard in Ant's Available command

Hi all, I'm using an Ant build script to collate my Eclipse-based application for distribution. One step of the build is to check that the correct libraries are present in the build folders. I currently use the Ant command for this. Unfortunately, I have to amend the script each time I switch to a new Eclipse build (since the version...

problem in build.xml

My build.xml is building successfully.But it is not creating or copying all the folders and files. It took only 1 sec for building. I think it have to to round about 1 min. I tried to find out whats wrong by giving echo in different point. I could see that when I put echo somewhere it show the message in the echo two time,somewhere it is...

sshexec ant task: environment variables

I'm using SSHExec ant task to connect to a remote host and I depend on the environment variables that are set on the remote host in order to be able to successfully execute some commands. <sshexec host="somehost" username="${username}" password="${password}" command="set"/> Using the task the env. variables that are output...

Maven: Java classes don't compile after Ant task

My project generates source code using the Rats! parser generator. Rats! doesn't have a Maven plugin that I'm aware of, so I'm trying to build the parser using an Ant Java task, like so: <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>generate-sources</phase> <configuration...

How can I connect to an Oracle database from Ant using the tnsname?

I am looking for something similar to the Ant sql task but that will accept a JDBC url of the format: jdbc:oracle:thin:@TNS_NAME One possible approach seems to be to write my own Ant task that uses an OracleDataSource to create the Connection, but is there a way to do this straight in Ant? EDIT: Thanks for the responses so far g...

How to include default package in Ant javac Task

When I: <javac srcdir="${src}" destdir="${build.classes.dir}" classpathref="classpath"> <include name="ObjectInDefaultPackage"/> <include name="com/mypackage/**"/> </javac> It will no longer add compile and add the class ObjectInDefaultPackage that's in the default package (ie. it's not packaged, it's sitting on the man ${src}...

Problem while building with build.xml

When I run the ant file in verbose mode, I got an error like the one below. Does anyone have any ideas what is going wrong? I am new to this antlib:org.apache.tools.ant] Could not load definitions from resource org/apach e/tools/ant/antlib.xml. It could not be found. Override ignored for property "java.home" BUILD FAILED Target "build.....

problem in build.xml

When I gave ant myproject-war. I got the following error. can any one help plzz BUILD FAILED C:\Documents and Settings\personal\Desktop\project files\myproject\bu ild.xml:167: taskdef A class needed by class org.apache.jasper.JspC cannot be fo und: javax/servlet/ServletContext ...

Automatic update of keyword in Word document

As part of our build process (java build with ant), I want to update a version number somehow in or near a Word document (software guide). "near" meaning I'd accept updating the document properties rather than something in the text itself. From looking around the internets, it looks like the main option is writing a small C# program tha...

Ant dependency management

It seems that ant dependency management isn't great to say the least... But, is there hope? Today there are better choices for build or project management such as maven, ivy but I'm stuck with a bunch of ant project that depend on one another so I was wondering if there's an "ant best practice" for managing dependencies. Specifically in...

Can you help me avoid a kludging JUnit in a master/slave Ant build setup?

We're using the task within our master build to invoke targets in separate ant builds for each of our sub-projects. So far so good, we get things built, we can even run JUnit tasks within each one and everybody is happy. However... We want to take it to the next level, we would like to have a single JUnit report generated from the JUni...

Custom tasks in Ant: addTYPE(TYPE x) vs add(TYPE x) (latter doesn't work)

I'm writing a custom Ant task that needs to accept a custom nested type. According to the Ant manual, I should be able to use addConfigured(TYPE x) rather than addConfiguredTYPE(TYPE x). Also, according to this article (section New Reflection rules, Polymorphism in Ant 1.6) support for addConfigured(TYPE x) was added in Ant 1.6. <taskd...

taskdef A class needed by class org.apache.jasper.JspC cannot be found: Could not initialize class org.apache.jasper.JspC

Hi I am getting the error taskdef A class needed by class org.apache.jasper.JspC cannot be found: Could not initialize class org.apache.jasper.JspC when I tried to build the build.xml file. can anyone please give me a solution. Thanks in advance ...

How do I copy .app bundles with Ant on Mac OS X?

Hey guys, I just had a quick question about copying files on Mac os x with ant. I've written myself a great little build script for my iPhone development. The script copies the compiled .app files that are created from xcodebuild. Anyway, the ant command does not seem to work. It does not copy the .app file correctly. it copies the cont...

How can I replace a nested <resourcecount> within a <condition> with ant 1.6?

Hi there, I'm working with Ant 1.6 and cannot use a "resourcecount" within a "condition". Basically, I'd like to check if a FileSet contains elements according to regex: <condition property="foo.exist"> <resourcecount when="greater" count="0"> <filelist dir="." files="*foo*" /> </resourcecount> </condition> Normally this w...