ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <anto...@gmx.de>
Subject RE: Silent errors
Date Thu, 24 Apr 2014 18:18:45 GMT
Do you mean that you are creating jar files with a manifest containing for instance Main-Class:
${mainclass} instead of Main-Class: com.some company.SomeApp ?
Ant does not enforce that properties be set before they are used. When an ant task is invoked
with the place holder ${someproperty} and someproperty is not set then the task sees literally
${someproperty}.
What you can do to mitigate this risk is to add the following to your build file
<fail unless="someproperty" message="someproperty is not set" />
I hope this helps,
Antoine

Le 24 avr. 2014 09:43, "Miller, Gerald" <Gerald.Miller@Vistronix.com> a écrit :
>
> Sorry for the incomplete sentences.  It's hard to see what I've typed, especially when
every application uses slightly dark fonts on a slightly lighter background, so by the time
I get to the end of a long sentence, it sometimes sounds rambling.  Anyway, what I meant
to say is that when I asked other people about this problem, they had no more clue than I
did, which makes me feel better that I'm not the only one who doesn't find it intuitive. 
>
> -----Original Message----- 
> From: Miller, Gerald [mailto:Gerald.Miller@Vistronix.com] 
> Sent: Thursday, April 24, 2014 9:36 AM 
> To: user@ant.apache.org 
> Subject: Silent errors 
>
> It turns out I'm not the only one here who simply modifies existing build files, although
I have managed to exclude descendants of an included fileset dir attribute.  When I asked
why a non-existent Main-Class value wouldn't generate an error and, at least on one installation,
still allow the correct one (and others not mentioned) to be accessed by their correct names. 
This lack of error messages, in contrast to compilers that warn about the most trivial things,
doesn't help with diagnosing why one workspace is able to build a valid jar, while another
while a copy possibly using different versions of Eclipse and Ant produces a jar that can't
find the main class.  There are all kinds of threads about this problem, all with different
suggestions.  I could spend a lot of time trying them if I were so inclined, but most of
their examples don't even resemble my build file.  Any idea if this is a red herring or not? 
Thanks. 
>
> This communication, along with its attachments, is considered confidential and proprietary
to Vistronix.  It is intended only for the use of the person(s) named above.  Note that
unauthorized disclosure or distribution of information not generally known to the public is
strictly prohibited.  If you are not the intended recipient, please notify the sender immediately.

>
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org 
> For additional commands, e-mail: user-help@ant.apache.org 
>
Mime
View raw message