Re: failonerror for target and depends

2009-07-23 Thread dkhanna123
Its just that all my ant xml script are generated on the fly using xslt. Now in some of the cases I don't even have target1 defined and that's where the problem lies. But looks like its not possible, so I'll have make some changes to my xslt code itself. Thanks David Weintraub wrote: > >> I

Re: How to pass Java system properties to a task defined in a taskdef ?

2009-07-23 Thread Jean-Noël Rivasseau
Thanks for this answer. The problem however is that I don't control the code of the Ant task - I am patching the build system of a big package (Groovy) to build on Gentoo Linux, so the only thing I can / should modify is the buildfile. Is there a way to tell the Java code that will be run inside th

Re: failonerror for target and depends

2009-07-23 Thread David Weintraub
I understand how depends works but my question is.. If I have two targets defined in depends for e.g depends="target1,target2", and if some how target1 does not exist and instead of throwing error ant should move ahead (after showing some warning) and execute target2. If you don't depend

Re: failonerror for target and depends

2009-07-23 Thread dkhanna123
Hi I understand how depends works but my question is.. If I have two targets defined in depends for e.g depends="target1,target2", and if some how target1 does not exist and instead of throwing error ant should move ahead (after showing some warning) and execute target2. THanks David Weintra

Re: failonerror for target and depends

2009-07-23 Thread David Weintraub
When you state that a target "A"is dependent upon target "B", target "B" MUST run and execute before target "A" can execute. Ant isn't a programming language. It is a dependency matrix. You specify which targets are dependent upon other targets, and Maven will sort out the build order for you. Are

Re: Problem while sending Mail through ANT

2009-07-23 Thread David Weintraub
If you don't use MIME encoding, you don't need any additional jars for mail. However, if you use MIME encoding, you need the following jars: mail.jar Mail task with Mime encoding, and the MimeMail task http://java.sun.com/products/javamail/ jsse.jar Support for SMTP over TLS/SSL in the Mail task

Re: How to pass Java system properties to a task defined in a taskdef ?

2009-07-23 Thread Avlesh Singh
> > My original question was completely misunderstood > Probably because you never mentioned the usage inside a custom task. Use these within you Ant tasks: this.getOwningTarget().getProject().getProperty("user.home"); this.getOwningTarget().getProject().getProperties(); Cheers Avlesh On Thu, Ju

Re: How to pass Java system properties to a task defined in a taskdef ?

2009-07-23 Thread Jean-Noël Rivasseau
Hmm. My original question was completely misunderstood. Here is what I am doing: ant -Duser.home="bar" The build file looks like this: Then the code in Test.java goes like this: System.out.println("Property: " + System.getProperty("user.home")); The result of the Ant echo message is what I

Programmatically invoking Ant libraries to sign jar files - Example

2009-07-23 Thread Daniele Development-ML
Hello everybody, some time ago I emailed to ask details/examples on how to programmatically invoke Ant libraries to sign a jar file. There were contrasted opinion on whether Ant libraries could be invoked directly and I was invited to post an example when (and if) I was successful in this. With a

Re: How to pass Java system properties to a task defined in a taskdef ?

2009-07-23 Thread Scot P. Floess
You can echo that property using Its automagically available via the Java system property... On Thu, 23 Jul 2009, Scot P. Floess wrote: Well, user.home is a Java system property. I'm guessing the intent is to change that system property internal to the script? On Thu, 23 Jul 2009, Avle

Re: How to pass Java system properties to a task defined in a taskdef ?

2009-07-23 Thread Scot P. Floess
Well, user.home is a Java system property. I'm guessing the intent is to change that system property internal to the script? On Thu, 23 Jul 2009, Avlesh Singh wrote: If you are trying to read the environment variable "user.home", this is how you need to it: Cheers Avlesh On Thu, Jul 23

Re: How to pass Java system properties to a task defined in a taskdef ?

2009-07-23 Thread Avlesh Singh
If you are trying to read the environment variable "user.home", this is how you need to it: Cheers Avlesh On Thu, Jul 23, 2009 at 8:18 PM, Scot P. Floess wrote: > > Are you trying to set it within your build.xml - like so: > > > > If so, I don't think that is going to work... > > For exampl

failonerror for target and depends

2009-07-23 Thread dkhanna123
I have a target defined as : Now I want when ant call prompt target and if "init1" DOESNOT exist then it should continue with init2 and init3. I have used ant -k option but instead of continuing with init2 and init3 the whole prompt target exits. ANy suggestions -- View this message in conte

Re: Problem while sending Mail through ANT

2009-07-23 Thread Gilbert Rebhan
Ajit Dusane schrieb: > Hi, > > I want to send one file as an attachment while sending mail through ANT. > But I am getting one error while sending mail. Could you please tell me the > way it can be resolved??? > > I am using Ant version 1.7.1 > > Error: > Email: > [mail] Failed to initiali

Problem while sending Mail through ANT

2009-07-23 Thread Ajit Dusane
Hi, I want to send one file as an attachment while sending mail through ANT. But I am getting one error while sending mail. Could you please tell me the way it can be resolved??? I am using Ant version 1.7.1 Error: Email: [mail] Failed to initialise MIME mail: javax/mail/MessagingException

Re: How to pass Java system properties to a task defined in a taskdef ?

2009-07-23 Thread Scot P. Floess
Are you trying to set it within your build.xml - like so: If so, I don't think that is going to work... For example try this out: When I run this, I get: Buildfile: build.xml [echo] /home/sfloess However, if I do this: ant -Duser.home="bar" I get: Buildfile: build.xml

Re: How to pass Java system properties to a task defined in a taskdef ?

2009-07-23 Thread Scot P. Floess
Just curious - you mention a modified user.home property... How are you modifying it? On Thu, 23 Jul 2009, Jean-Noël Rivasseau wrote: Hello, I am launching Ant with a modified user.home property. This property is apparently not passed down to one of my tasks, defined in a taskdef. Why? Doe

RE: Overriding previous definition of reference to ...

2009-07-23 Thread Nestor Dutko
That't not quite what I am seeing though. This is the explicit extract of the declarations - as you can see And all of the files include the com

How to pass Java system properties to a task defined in a taskdef ?

2009-07-23 Thread Jean-Noël Rivasseau
Hello, I am launching Ant with a modified user.home property. This property is apparently not passed down to one of my tasks, defined in a taskdef. Why? Does Ant fork a new VM for executing such tasks? In any case, how can I pass this property to the task being executed, it's essential for me. I