You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ba...@goodconsultants.com on 2004/01/23 01:35:16 UTC

ant -k and -D flags together will not work?

All,

I am trying to avoid build stopping by using "-k" on top of the original ant
command, "ant -DBUILDNUMBER=123 targetA" but it does not work?

Why? What should be the correct syntax?

Thanks

Barry



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ant -k and -D flags together will not work?

Posted by "Alexey N. Solofnenko" <A....@mdl.com>.
You just said that server_b depends on server_a. If server_a build fails 
then server_b cannot be built. It is possible to divide server_a build 
into separate stages and make server_b depend only on a part of server_a 
build that does not fail.

- Alexey.

Baz wrote:

>Stefan and all,
>
>Yes i do have a serious issue with that...  My case is like the followings:
>
>/top_level_dir/build.xml
>                /server_a/build.xml
>                /server_b/build.xml
>
>build.xml from toplevel directory calling level_a/build.xml by doing <ant
>dir="server_a" Inhertitall="false" Target="all"/>
>
>build.xml from toplevel directory calling level_b/build.xml by doing <ant
>dir="server_b" Inhertitall="false" Target="all"/>
>
>where server_b depends on server_a, and both server_a and server_b have
>their own build.xml so that developers can go into server_b directory and
>just build server_b.
>
>Issue #1) When server_a failed in the javac task, and by default,
>failonerror="true", the whole build from /top_level_dir/build.xml just
>stopped. server_b does not get compile. True, server_b will fail even if it
>is going to be compile.
>
>Issue #2) However, the correct behaviour should be server_a failed in javac
>compilation, then start compiling server_b and server_b fails too. This can
>be done if I set the failonerror="false" in javac task of server_a. However,
>then the build will return SUCCESSFUL which is a wrong behaviour.
>
>Thanks and please comment.
>
>B.
>
>----- Original Message ----- 
>From: "Stefan Bodewig" <bo...@apache.org>
>To: <us...@ant.apache.org>
>Sent: Thursday, January 22, 2004 11:19 PM
>Subject: Re: ant -k and -D flags together will not work?
>
>
>  
>
>>On Thu, 22 Jan 2004, Baz <ba...@goodconsultants.com> wrote:
>>
>>    
>>
>>>Cannot execute 'javadoc' - 'compile' failed or was not executed.
>>>Cannot execute 'dist' - 'compile' failed or was not executed.
>>>Cannot execute 'all' - 'javadoc' failed or was not executed.
>>>      
>>>
>>Maybe we should -k better, then.
>>
>>If a target fails, all targets that depend on that target are going to
>>be skipped.  If you use -k it means that any other targets that are
>>also part of the build process but do not depend on the failing target
>>will be executed.
>>
>>What would you expect a dist target to do if compilation failed?
>>
>>Stefan
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ant -k and -D flags together will not work?

Posted by Baz <ba...@goodconsultants.com>.
Stefan and all,

Yes i do have a serious issue with that...  My case is like the followings:

/top_level_dir/build.xml
                /server_a/build.xml
                /server_b/build.xml

build.xml from toplevel directory calling level_a/build.xml by doing <ant
dir="server_a" Inhertitall="false" Target="all"/>

build.xml from toplevel directory calling level_b/build.xml by doing <ant
dir="server_b" Inhertitall="false" Target="all"/>

where server_b depends on server_a, and both server_a and server_b have
their own build.xml so that developers can go into server_b directory and
just build server_b.

Issue #1) When server_a failed in the javac task, and by default,
failonerror="true", the whole build from /top_level_dir/build.xml just
stopped. server_b does not get compile. True, server_b will fail even if it
is going to be compile.

Issue #2) However, the correct behaviour should be server_a failed in javac
compilation, then start compiling server_b and server_b fails too. This can
be done if I set the failonerror="false" in javac task of server_a. However,
then the build will return SUCCESSFUL which is a wrong behaviour.

Thanks and please comment.

B.

----- Original Message ----- 
From: "Stefan Bodewig" <bo...@apache.org>
To: <us...@ant.apache.org>
Sent: Thursday, January 22, 2004 11:19 PM
Subject: Re: ant -k and -D flags together will not work?


> On Thu, 22 Jan 2004, Baz <ba...@goodconsultants.com> wrote:
>
> > Cannot execute 'javadoc' - 'compile' failed or was not executed.
> > Cannot execute 'dist' - 'compile' failed or was not executed.
> > Cannot execute 'all' - 'javadoc' failed or was not executed.
>
> Maybe we should -k better, then.
>
> If a target fails, all targets that depend on that target are going to
> be skipped.  If you use -k it means that any other targets that are
> also part of the build process but do not depend on the failing target
> will be executed.
>
> What would you expect a dist target to do if compilation failed?
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ant -k and -D flags together will not work?

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 22 Jan 2004, Baz <ba...@goodconsultants.com> wrote:

> Cannot execute 'javadoc' - 'compile' failed or was not executed.
> Cannot execute 'dist' - 'compile' failed or was not executed.
> Cannot execute 'all' - 'javadoc' failed or was not executed.

Maybe we should -k better, then.

If a target fails, all targets that depend on that target are going to
be skipped.  If you use -k it means that any other targets that are
also part of the build process but do not depend on the failing target
will be executed.

What would you expect a dist target to do if compilation failed?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ant -k and -D flags together will not work?

Posted by Baz <ba...@goodconsultants.com>.
Alexey and all,

I was using almost not modified tomcat build.xml.

compile:
    [javac] Compiling 51 source files to
C:\cygwin\home\barry\magnesium\src\serv
er\src\java\pS\build\WEB-INF\classes
    [javac] C:\cygwin\home\barry\magnesium\src\server\src\java\pS\src\
com\es\demo\bo\impl\R.java:25: com.es.demo.bo.impl.R is not abstract and d
oes not override abstract method getNamexxx() in com.es.demo.bo.IRule
    [javac] public class Rule implements IRule {
    [javac]        ^
    [javac] Note: C:\cygwin\home\barry\magnesium\src\server\src\java\pS
\src\com\es\jsp_utils\Request.java uses or overrides a depreca
ted API.
    [javac] Note: Recompile with -deprecation for details.
    [javac] 1 error
Target 'compile' failed with message 'Compile failed; see the compiler error
out
put for details.'.
Cannot execute 'javadoc' - 'compile' failed or was not executed.
Cannot execute 'dist' - 'compile' failed or was not executed.
Cannot execute 'all' - 'javadoc' failed or was not executed.

BUILD FAILED
C:\cygwin\home\barry\magnesium\src\server\src\java\pS\build.xml:297: C
ompile failed; see the compiler error output for details.

Any ideas why? Thanks.

B.

----- Original Message ----- 
From: "Alexey N. Solofnenko" <A....@mdl.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Thursday, January 22, 2004 5:34 PM
Subject: Re: ant -k and -D flags together will not work?


> Hello Barry,
>
>   I just tried "ant  -k -DTEST=0 init" and it worked fine. What command
> did you execute?
>
> - Alexey.
>
> barry@goodconsultants.com wrote:
>
> >All,
> >
> >I am trying to avoid build stopping by using "-k" on top of the original
ant
> >command, "ant -DBUILDNUMBER=123 targetA" but it does not work?
> >
> >Why? What should be the correct syntax?
> >
> >Thanks
> >
> >Barry
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> >For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ant -k and -D flags together will not work?

Posted by "Alexey N. Solofnenko" <A....@mdl.com>.
Hello Barry,

  I just tried "ant  -k -DTEST=0 init" and it worked fine. What command 
did you execute?

- Alexey.

barry@goodconsultants.com wrote:

>All,
>
>I am trying to avoid build stopping by using "-k" on top of the original ant
>command, "ant -DBUILDNUMBER=123 targetA" but it does not work?
>
>Why? What should be the correct syntax?
>
>Thanks
>
>Barry
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org