ant

ANT. Override properties. Optional Execution in Single Target

I'm going to post a question that I've seen variants of elsewhere, but where I've not quite seen the answer I came up with. I'll subsequently post my answer. In order to modularize my build script using macros, I would like to put both the updatetask and the task I want to execute if it is not up to date, in the same macro. How do I do...

Problem making ant compile my classes present in different Eclipse projects into single destination Directory

I have close to about 20 projects in my Eclipse workspace. They are interdependent. Now I want to build all of them in a single war file. The thing is eclipse does it nicely... if I create a Dynamic Web Project and link sources of all the 20 projects. But I want to automate the entire process and want to be able to run a script (ant mayb...

How to use Apache ivy to resolve dependency with multiple files?

Here is my ivy.xml: <?xml version="1.0" encoding="UTF-8"?> <ivy-module version="2.0"> ... <dependencies> <dependency org="spring" name="richclient" rev="1.1.0"/> </dependencies> </ivy-module> And ivy-settings.xml: <property name="ivy.local.default.root" value="/home/---/dev/Java/_libraries/_ivy" override="false"/> <...

ant to detect freeBSD

Is there a way to detect freeBSD with ant. I used os.name it shows it as linux. I want to differentiate between freeBSD and linux. ...

copy file from unix system to windows using ant

can any one help me how to copy file from unix Windoes system to windows UNIX using ant? Thanks in advance EDIT Let me explain in detail what I am looking for I want to copy file from windows to unix machine (correcting my previous question not from unix to windows) using ANT. I thought of using ftp task. Before that as a check I ...

JAMES Mailet development process

I'm starting a project that involves writing mailets for Apache James. As far as I can tell, the only way to test a change in my code (on Windows) is through the following steps: Compile the mailet code Build a jar file containing the mailet Copy the jar file into the apps/james/SAR-INF/lib directory Start JAMES from run.bat Run test S...

How to checkout from SVN with an ANT task?

I'm interested in any way that I can create an Ant task to checkout files from SubVersion. I "just" want to do the checkout from the command line. I've been using Eclipse with Ant and SubVersion for a while now, but my Ant and SubVersion knowledge is somewhat lacking as I relied on Eclipse to wire it all together. I've been looking at S...

Why is my spawned process still causing IntelliJ to wait?

I'm trying to start a server as part of an Ant artifact. Here are the relevant lines: <exec dir="." executable="cmd.exe" spawn="true"> <arg line="/c c:\Java\james-2.3.2\bin\debug.bat" /> </exec> If I start it with ant from the command line, a process is spawned and I get a command prompt and everything seems fine. Ho...

How-to-create-or-delete a folder on the unix machine using ant task whic runs in windows machine

Hi folks I need to delete a directory in unix and create a new one - all should be part of ant task in windows machine Thanks Vishu ...

How do I set the Eclipse build path and class path from an Ant build file?

Hey folks, There's a lot of discussion about Ant and Eclipse, but no previously answered seems to help me. Here's the deal: I am trying to build a Java program that compiles successfully with Ant from the command-line. (To confuse matters further, the program I am attempting to compile is Ant itself.) What I really want to do is to br...

How to use GCJ with ant?

I'm fairly new to both Apache Ant and GCJ, and I'm having a hard time trying to build with GCJ via Ant. My app is in Scala, so I need to use GCJ to take .class files as source. No problem compiling .scala to .class with Ant. First I figured out how to manually compile a .class file to .o (object), this way: gcj --classpath=(...) -c (...

Using ant to add directories to CVS

How do I add a new directory into my CVS repository using Ant? From all that I've read, it appears that I have to cd to the parent directory and call the cvs command. How do I do that in Ant? I've seen approaches where an to cd is called in Ant; is that the best approach? Eg of what I am trying to do: Let's say I have a module Test_Mod...

How to debug Java code when using ANT script in Eclipse

Hi, I have a java class and I need to debug it (put breakpoints and continue using F6). I am using ANT script to init, build, deploy and run the code. I am using: <javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true" debuglevel="lines,vars,source"> .......... </javac> But when I place the breakpoint in a line in my foo.j...

Modify web.xml using Ant

Is there any way to strip elements out of a web.xml file using ANT? For example I have certain servlets I use for Unit Testing defined in the web.xml that are unnecessary in the production environment is there a way to strip these out or do I need to have a separate production web.xml file? Thank You. ...

How can I execute an ant task more than once?

Imagine this as the code from build.xml: <project name="test project"> <target name="first"> <echo>first</echo> </target> <target name="second" depends="first"> <echo>second</echo> </target> <target name="third" depends="first,second"> <echo>third</echo> </target> </project> What do I ne...

Ant fileset confusion

Let's say I have this in one of my targets: <path id="files"> <fileset dir="${env.DIRECTORY}" casesensitive="false"> <include name="**/*.html"/> <exclude name="**/*ant*"/> </fileset> </path> I'd like to group all the html files, except the ones containing the string ant. The way I wrote it above, it does not work. I a...

Ant task to remotely delete a directory

Is there a way except the sshexec task to do this? I know that you can copy files with the scp task. However, I need to do additional things like check if some folders are there then delete them. I would like to use something like the condition task and delete task for this. For now I have set it up with the sshexec task. But this will m...

Ant in Eclipse: silently terminated

I'm using an Ant build script for my project developed in Eclipse 3.4.2. It's actually a Flex 4 project (using Flash Builder Eclipse Plug-in). Everything worked ok. But someday something happened and now the executions of Ant build script is silently terminated each time I run it. When trying to debug Ant script the IDE stops for a mom...

How can I synchronize two folders using Ant?

Let's say I copy some files with ant, from a network drive: <copy todir="." verbose="true"> <fileset dir="some_directory" includes="**/*"/> </copy> Let's say I test if the folder exists first. <available file="${dir.local}" property="dir.exists"/> If I have the folder on my computer, I would like to only copy the files that are ...

how change property value in file by Ant

Example input: SERVER_NAME=server1 PROFILE_NAME=profile1 ... Example output: SERVER_NAME=server3 PROFILE_NAME=profile3 ... This file will use in applicationContext.xml. I've tried <copy file="${web.dir}/jexamples.css_tpl" tofile="${web.dir}/jexamples.css" > <filterchain> <replacetokens> <token key="...