Hi all,
I'm trying to use the AntUnit framework to test some custom Ant tasks.
Unfortunately it's proving very much a black box, and when a test fails
I can't find any Ant log for the test case. I've read the AntUnit
documentation on the resource, and I obviously didn't
fully understand it.
I'
There is a createArg() method which sounds like what you want.
The manual included in the Ant download has API docs for all the tasks, as well
as some general guidance for programming to the API.
Hope this helps
Keith
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
released 1.7.1.
https://issues.apache.org/bugzilla/show_bug.cgi?id=42263
Peter
On Mon, Mar 3, 2008 at 9:53 AM, Keith Hatton <[EMAIL PROTECTED]>
wrote:
> It seems that something has changed between Ant 1.6.2 and 1.7.0 in the
> way the ant.version property is handled when another b
It seems that something has changed between Ant 1.6.2 and 1.7.0 in the
way the ant.version property is handled when another build file is
invoked using the task.
Given the following files:
main-build.xml:
Ant version is ${ant.version}
sub-build.xml:
Ant
Hi,
Versions: Ant 1.6.2 and 1.6.5, Java 1.5.0_05.
I have an Ant script that needs to call an Ant target with a different
environment (specifically with a different -lib setting) so I use
to run this in a separate process as follows (the -lib is removed from
the arg sections here because the prob
You probably need to use the XML escape sequence "&"
Hope this helps
Keith
-Original Message-
From: Krzysztof Kucybala [mailto:[EMAIL PROTECTED]
Sent: 24 August 2007 09:13
To: Ant Users List
Subject: Is & a somehow special character to Ant?
Hi,
I'm trying to use the exec task to issu
Hi,
I have cases where it would be useful to call a macrodef if a property
was set, but to skip it otherwise. If these were targets I could use the
standard Ant if/unless attributes to achieve this behaviour, but
macrodefs are called explicitly at certain points in the build file,
rather than usi
A favourite that trips me up is that the destination files are newer
than the source files, so no copy actually happens. Maybe you need to
add overwrite="true" to the ?
Hope this helps,
Keith
-Original Message-
From: jake_ryan [mailto:[EMAIL PROTECTED]
Sent: 01 March 2007 16:14
To: user
It sounds like a combination of and might meet your
basic requirements, though you may have to provide your own condition
implementation depending on what "the task" is.
http://ant.apache.org/manual/index.html
Keith
-Original Message-
From: Hans Schwaebli [mailto:[EMAIL PROTECTED]
Sen
Hi Hans,
Can you rewrite your query so that it will produce output like
PropertyName=388291
0 rows affected
(e.g. you might write SELECT 'PropertyName=' || (your original column)
FROM ...)
Then you can write that output to a file and use
to read it into a property (the "0 rows affected" line
Two more robust solutions spring to mind:
1. You can use Properties.getProperty(String,String) to prevent your
NPE. The first string is the property name, the second is a default
value to be used when the property is not present.
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#ge
You can include other jars in the Class-Path entry of the manifest file
of your jar, then just distribute all jars in the same folder (assuming
you're allowed to distribute them).
HTH
Keith
-Original Message-
From: Peter DePasquale [mailto:[EMAIL PROTECTED]
Sent: 01 November 2006 01:26
This should work.
It's just like putting special characters into an HTML document.
Please keep the thread on the mailing list.
HTH
Keith
-Original Message-
From: Nagender Malik
[mailto:[EMAIL PROTECTED]
Sent: 11 September 2006 13:50
To: Keith Hatton
Subject: Re: How to use Q
"
HTH
Keith
-Original Message-
From: Nagender Malik
[mailto:[EMAIL PROTECTED]
Sent: 11 September 2006 13:41
To: Ant Group
Subject: How to use Qoutes with arg element
Hi All,
How to use ""(quotes) in the elements:
For example:
Please suggest..
regards,
Nagender
-
Hi,
I've had a look at the manual and not found anything to suggest that I
can, but just wondered if there is a way to remove files from a zip when
using ?
I can see this isn't a "normal" requirement: what I want to do is add
commons-logging-1.1.jar to the WEB-INF/lib folder of a WAR file, and
This could be because the ! character indicates a resource within a JAR
file.
(see
http://java.sun.com/j2se/1.5.0/docs/api/java/net/JarURLConnection.html)
Hope this helps
Keith
-Original Message-
From: madhuvanti joshi [mailto:[EMAIL PROTECTED]
Sent: 10 July 2006 06:20
To: Ant Users Li
I think you need to specify that in the URL for the JDBC connection.
http://dev.mysql.com/doc/refman/5.0/en/cj-configuration-properties.html
It's really a MySQL/JDBC configuration question.
Hope this helps
Keith
-Original Message-
From: Eitan Gur [mailto:[EMAIL PROTECTED]
Sent: 27 June
RAR as in J2EE Resource ARchive file?
Just use with and , and .
Hope this helps
Keith
-Original Message-
From: Leon Pu [mailto:[EMAIL PROTECTED]
Sent: 27 June 2006 04:42
To: Ant Users List
Subject: How to handle RAR in Ant
Hi all,
how to create and extract RAR file in Ant build scr
See the following:
http://java.sun.com/j2se/1.3/docs/api/java/lang/package-summary.html#cha
renc
"The default encoding is determined during virtual-machine startup and
typically depends upon the locale and encoding being used by the
underlying operating system."
You can use -Dfile.encoding=xxx on
Try running without a CLASSPATH environment variable.
Maybe your CLASSPATH contains unquoted spaces (e.g., Program Files), or
ends in a backslash character.
Hope this helps
Keith
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 01 May 2006 15:50
To: user@ant.ap
Two possibilities that spring to mind:
1. the files you require from either source tree to a single
working directory structure, then from there.
2. the generated files you don't want before invoking .
As a general rule, I prefer introducing simplicity over hiding
complexity, by which I mean
XML escapes are just like HTML.
So
< = <
> = >
& = &
etc.
Keith
-Original Message-
From: Michael Atlas [mailto:[EMAIL PROTECTED]
Sent: 25 April 2006 16:36
To: user@ant.apache.org
Subject: Replace task value can't take less than sign.
This is the task I am trying to run:
Option 1. the files before so that they will definitely
have a newer timestamp.
Option 2. the archive, the files to be
replaced, then to create a new WAR file.
Hope this helps
Keith
-Original Message-
From: Torgeir Veimo [mailto:[EMAIL PROTECTED]
Sent: 30 March 2006 14:35
To: user
Not sure if this is the problem, but you can use markers
to escape the HTML within your build file.
Hope this helps
Keith
-Original Message-
From: Sommers, Elizabeth [mailto:[EMAIL PROTECTED]
Sent: 30 January 2006 16:45
To: 'user@ant.apache.org'
Subject: echo with html
Does anybody h
I'm using Ant 1.6.2 and I need to include deployment descriptor files in
the WEB-INF section of my WAR file. However I need to rename them when I
include them so that, for example, console-weblogic.xml becomes
weblogic.xml and console-orion-web.xml becomes orion-web.xml.
I skimmed the section on m
Did you install Ant 1.6.5 yourself? This sounds like there may be
multiple Ant installations - for example, one might be packaged with
RedHat by default.
Trying something like "which ant" might give you some help.
FYI, in Ant 1.6 the Launcher class it's complaining about is in
ANT_HOME/lib/ant-la
ea?
- Original Message -
From: "Keith Hatton" <[EMAIL PROTECTED]>
To: "Ant Users List"
Sent: Tuesday, November 01, 2005 3:39 PM
Subject: RE: Jboss start and stop scripts
This works for me - on Windoze anyway, I'm sure you can
This works for me - on Windoze anyway, I'm sure you can do something
similar on other platforms.
HTH
Keith
-Original Message-
From: Andrei [mailto:[EMAIL PROTECTED]
Sent: 01 November 2005 12:36
To: Ant Users List
Subject: Re:
You could only the files that should be included to a working
directory and run from there.
Hope this helps
Keith
-Original Message-
From: Mikael Petterson (KI/EAB) [mailto:[EMAIL PROTECTED]
Sent: 12 October 2005 13:41
To: user@ant.apache.org
Subject: possible to filter java packages
I've had problems with updating JAR files in the past when the "updated" file
is in fact older than the one already in the archive (and "older" may mean
"newer within 2 seconds" on Windoze). So you may want to it first. Or
as Jan suggested, do an , then for your
application.xml, then it back
Hi Marcel,
I don't think you are doing anything wrong, and I don't think it is necessarily
a bug either.
Generally -type elements are only used when Ant starts a new JVM
(, , etc.), so this would require your or
element to have a fork="true" attribute.
However the Ant manual (http://ant.apac
forkmode="once" will take care of that if you are using Ant 1.6.2+.
Also, http://gsbase.sourceforge.net/ has a set of Junit extensions such as an
OrderedTestSuite that might help you. (Of course, the purist approach says your
unit tests should be independent of one another, but there can be times
Do you simply need a that points to a directory where your
properties file is?
The you have defined consists solely of jar files.
Hope this helps
Keith
-Original Message-
From: Prasad Iyer [mailto:[EMAIL PROTECTED]
Sent: 13 July 2005 12:01
To: user@ant.apache.org
Subject: taskdef & lo
Check the manual for ?
Hope this helps
Keith
-Original Message-
From: Nir Geier [mailto:[EMAIL PROTECTED]
Sent: 29 June 2005 13:58
To: Ant Users List
Subject: problem:
hi again,
im trying to use and I keep getting the following exception:
(make no difference if there is no internal
I've found the GSBase extension for Junit (www.gargoylesoftware.com)
useful for doing this sort of thing. It's simply a matter of returning a
different implementation from the static suite() method in your test
case class.
I'm not aware of anything in Ant that does this specifically, though.
Hope
I am not 100% sure that I have read your mail right but it sounds like
your WEB-INF folder is at the wrong level, which would make everything
else fail. (Are you using the task? This should make building the
file quite easy).
A war file should have the following structure
(root) <=
Andreas,
update="true" can be used on etc.
Make sure that the "new" versions of the files you wish to include
really do have later date/time stamps as that is the basis for applying
the update.
Of course, underneath Ant is extracting and recreating the archive as
you describe.
Hope this helps
Ke
The 'divide and conquer' strategy would be good here.
What happens if you run Ant 1.6.3 on JDK 1.4?
That way you will find out whether it's likely to be the JDK or the Ant
release that has broken things.
Hope this helps
Keith
-Original Message-
From: Bevan Arps [mailto:[EMAIL PROTECTED]
Possibly ANT_HOME is wrong.
Should be ANT_HOME=/usr/share/ant <== note, no /bin
Then you'll need to change your path so that it is ANT_HOME/bin and so
on.
Hope this helps
Keith
-Original Message-
From: mickeydog [mailto:[EMAIL PROTECTED]
Sent: 07 April 2005 14:30
To: user@ant.apache.o
ct: RE: MS Word automation
I thought of doing it from BSF but I don't know what language supports
COM automation. I can't find VBScript on the BSF page. I was hoping to
do it with Jython and am trying to get that to work.
Thanks for the suggestion though!
-David
-Original Messag
Maybe user
Isn't there a runant.pl in your ANT_HOME/bin?
-Original Message-
From: John Cortell [mailto:[EMAIL PROTECTED]
Sent: 11 March 2005 00:53
To: user@ant.apache.org
Subject: launching Ant from a perl script
Hi,
I'm having a tough time figuring out how to get the return code from an
Ant
in
, though it might not work if your OS is particularly obscure.
>> Remember, I'm new to ant.
Remember, There's a Fine Manual.
http://ant.apache.org/manual/index.html
-Original Message-
From: Payette, Don J [mailto:[EMAIL PROTECTED]
Sent: 10 March 2005 15:44
To: Ant Users List
Subject: R
Can you post your task?
Are you 'ing the .exe file? If it's a service, the command to
start it would be "net start ServiceName" - not sure whether "net" is a
valid target for or whether it has to be started with "cmd" ...
Hope this helps
Keith
-Original Message-
From: Robert Lin [mailt
could in
theory have run some tests, all of them failing. But what's the point of
running the report when you have no input ;-) Which is why I say it's
not really a flaw.
The fact that missed such 'crashing' failures may have been
fixed I think, as I vaguely recall a bug about
I recently did this but was unable to do it with a purely macrodef-based
approach.
The gist of my solution was to define the fileset generated by Junit.
Then check if it was actually there:
Then only do the junitreport if the property was set:
Keith
-Original Message-
From: Kasparek, Bernadette [mailto:[EMAIL PROTECTED]
Sent: 14 February 2005 12:51
To: 'Ant Users List'
Subject: AW: Two targets with the same depends-target
I need the following behavivor:
Ant all --> common, one, common, two
What can I do?
Ber
http://ant.apache.org/manual/index.html
Ant Tasks -> Optional Tasks -> Script
Be careful about the library dependencies - exactly which version of
BSF/Rhino you need will depend on which version of Ant you have (that
link currently points to the 1.6.2 manual).
Keith
-Original Message-
>
Hi Pritesh,
You need serverPath="\\your-vss-server\vss-share\path\to\vss" in your Ant task.
This path must be where the srcsafe.ini file is *on the server*.
Hope this helps
Keith
-Original Message-
From: Pritesh Saharey [mailto:[EMAIL PROTECTED]
Sent: 28 January 2005 07:00
To: Ant Users
It's all the environment variables that are currently set.
In Windoze, type SET at a Command Prompt.
Keith
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 25 January 2005 16:59
To: user@ant.apache.org
Subject: Re: Any way to get at the machine name?
James Ab
Shouldn't the -D... settings go immediately after "ant" and before "-buildfile
..."?
Keith
-Original Message-
From: Radha Sangal [mailto:[EMAIL PROTECTED]
Sent: 11 January 2005 16:01
To: Ant Users List
Subject: RE: passing parameters to ant
Changed command line :
cmd /c ant -buildfile
See the manual for the FixCRLF task.
http://ant.apache.org/manual/CoreTasks/fixcrlf.html
Hope this helps
Keith
-Original Message-
From: Glen Mazza [mailto:[EMAIL PROTECTED]
Sent: 10 January 2005 17:40
To: user@ant.apache.org
Subject: Automatic way to convert from DOS to Unix line endings
Looks like you have some (but not all) weblogic stuff in your CLASSPATH. I
would try removing that and see what happens.
Keith
-Original Message-
From: Arro [mailto:[EMAIL PROTECTED]
Sent: 15 December 2004 20:02
To: [EMAIL PROTECTED]
Subject: and Processor Version
I have been getting
to 'cast' to a build exception ? ***
throw new BuildException(e);
*** -> OK to use coma separated values for one property ? ***
yes
Peter
Keith Hatton wrote:
>Yeah, the .* is wrong and you have a typo in the third import (no . between
>Packages and java).
>
eas ?
Gilbert
-Original Message-
From: Keith Hatton [<a href="mailto:[EMAIL">mailto:[EMAIL</a> PROTECTED]
Sent: Tuesday, December 07, 2004 12:50 PM
To: Ant Users List
Subject: RE: script task using java
importPackage(Packages.java.lang);
etc.
Keith
-O
importPackage(Packages.java.lang);
etc.
Keith
-Original Message-
From: Rebhan, Gilbert [mailto:[EMAIL PROTECTED]
Sent: 07 December 2004 11:47
To: ant_user (E-Mail)
Subject: script task using java
Hi, i want to use an existing regex class into my build script.
This is my first try usi
Hi Geoff,
>From the JDK Tool docs:
java -jar ... "When you use this option, the JAR file is the source of all user
classes, and other user class path settings are ignored."
If you want to launch an application using java -jar, then build that jar file with a
Class-Path entry in its manifest.
Does your build.xml file contain a for axis-wsdl2java (the last bullet point
on the output from Ant)?
Assuming ${dir.lib.axis} is the directory where your Axis jars are,
...
-Original Message-
From: Lalith Weerasinghe [mailto:[EMAIL PROTECTED]
Sent: 30 June 2004 17:22
To: [
>> Also, I was under the impression that the standard
WEB-INF directory must be in upper case, but the ant
war task changes it to lower case. Is this related to
my problem? Does it matter? <<
WEB-INF is correct, and that is what Ant does. But be aware that WinZip often displays
this directory as
-Original Message-
>> So when is war/uptodate="true" valuable (or
>> zip/jar/war/ear for that
>> matter)?
>>
>Ya got me. ;) Maybe when you just want to add files
>to an archive and they don't all exist in an
>uncompressed form? Otherwise, someone might just have
>a preference to update
0, Errors: 0, Time elapsed: 0.016 sec
[junit] Testcase: testAdd took 0.016 sec
[junit] Testcase: testSubtract took 0 sec
[junit] Testcase: testMultiply took 0 sec
[junit] Testcase: testDivide took 0 sec
BUILD SUCCESSFUL
Total time: 1 second
C:\TanguyLand>
Keith Hatton wrote:
&
I'm just taking a look at Ant 1.6 and I'm having a problem with a build file that
works fine in 1.5.3.
java -version gives 1.3.1
ant -version gives 1.6
The only changes to the standard installation is that I've copied junit.jar and
xalan.jar into ANT_HOME/lib (which I did for Ant 1.5) - prior t
Perhaps you can use
Hi Svetlin,
As a work-around, could you all the source trees to a single temporary
location, and run from there?
Keith
-Original Message-
From: Svetlin Stanchev [mailto:[EMAIL PROTECTED]
Sent: 14 November 2003 13:58
To: 'Ant Users List'
Subject: RE: javadoc of multiple sub-projects
Hi all,
Is there any way to generate the build.xml file for a corresponding Project object
(other than by hand)?
The specific thing I am trying to do is to use Ant as an installer. The idea is, as I
collect user responses, I can build the Project and its Targets on the fly. And as I
go, I can
Doesn't
Could you telnet to a Windoze box and run VSS from there?
Perhaps with a Samba share back to the Linux box?
Never tried it, but maybe Rant (Remote Ant) is worth a look?
Keith
-Original Message-
From: Duffey, Kevin [mailto:[EMAIL PROTECTED]
Sent: 23 June 2003 17:34
To: Ant Users List
Subj
Your properties should either be in Java properties file format (name=value) or XML
format. The example you give below is neither.
If that doesn't help, suggest you post the properties file and build.xml for us to
look at.
Hope this helps
Keith
-Original Message-
From: Neil Walsh [mai
Hi Todor,
I think you need the element - look in the Ant docs for File Mappers.
Something like
Hope this helps
Keith
-Original Message-
From: Todor Boev [mailto:[EMAIL PROTECTED]
Sent: 02 April 2003 16:59
To: Ant Users List
Subject: *.java to *.class?
Hello all,
Assume I have a file
1. What does javac do from the command line, in the same circumstances?
2. The "obvious" thing is that one or more classes in your ejb package reference
classes in the other packages, which reference other classes ... which ends up with
155 classes being compiled.
Running ant with -debug or java
CTED]]
Sent: 11 February 2003 09:37
To: Keith Hatton
Subject: RE: RE: Missing & misleading documentation, help needed on advanced Jar
functionality (verification)
This is a spam mail prevention service.
Just this once, click the link below so I can receive your emails. You won't have t
I wouldn't try to make your application into one single jar file.
IMHO, it's better to have *your* class files in a jar file whose manifest contains
"Class-Path" entries pointing to the other jars your application requires. Then
there's no confusion about who supplies which class file, versionin
72 matches
Mail list logo