You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Gabriele Bodda <g....@gmail.com> on 2007/11/02 15:22:46 UTC

Headless Ant: problems with loggers and listeners

Hi all,

my name is Gabriele, I'm trying to automate my build process using
CruiseControl but I'm currently experiencing some critical problems with the
Ant command it generates.

Our project is developed using WebSphere Integration Developer (you know,
IBM-enhanced Eclipse), under Windows XP Professional.
My Ant script is quite standard, but it uses some of the custom tasks that
come inside the IDE plugins, such as "workspaceBuild" or "exportEar" .

I've read into the documentation that, in order to get access to the
resources required by this kind of build script, I need to configure CC to
start Ant externally via java. I have therefore written a customized
runAnt.bat, and from the logs I see that the complete command launched by CC
is this:

"D:\Programmi\IBM\Rational\SDP\6.0\eclipse\jre\bin\java"
-cp "D:\Programmi\IBM\Rational\SDP\6.0\eclipse\startup.jar"
org.eclipse.core.launcher.Main
-application com.ibm.etools.j2ee.ant.RunAnt
-data "D:\Temp\CC\checkout"
-logger net.sourceforge.cruisecontrol.builders.AntProgressXmlLogger
-listener net.sourceforge.cruisecontrol.builders.AntOutputLogger
-listener net.sourceforge.cruisecontrol.builders.AntProgressXmlListener
-DXmlLogger.file=log.xml
-lib D:\Programmi\CruiseControl\lib\cruisecontrol-antprogresslogger.jar
-debug
-Dcclastbuildtimestamp=20071029000000
-Dbuildforced=false
-Dlabel=build.1
-Dcclastgoodbuildtimestamp=20071029000000
-Dlastbuildsuccessful=false
"-Dcvstimestamp=2007-11-01 21:29:04 GMT"
-Dprojectname=Pagamenti
-Dcctimestamp=20071101222904
-buildfile build.xml build

Do you see anything wrong in it? The point is that it doesn't work, not only
when CC launches it, but also if I launch it manually (and this why I came
here looking for help...)
Moreover, it doesn't tell me anything useful to undestand what's wrong.

An important fact I'd like to point out to you is that everything works well
if I launch the same command without these parameters:

-logger net.sourceforge.cruisecontrol.builders.AntProgressXmlLogger
-listener net.sourceforge.cruisecontrol.builders.AntOutputLogger
-listener net.sourceforge.cruisecontrol.builders.AntProgressXmlListener
-DXmlLogger.file=log.xml
-lib D:\Programmi\CruiseControl\lib\cruisecontrol- antprogresslogger.jar

Does this tell you anything already, maybe a known problem or a common
pitfall?
In case not, please tell me what information you need to try to help me,
because I'm really short of ideas.

Thank you very much for your help,
Gabriele

Re: Headless Ant: problems with loggers and listeners

Posted by Darin Swanson <Da...@us.ibm.com>.
I have been working with Gab within the Eclipse newsgroups.
Eclipse had a bug in its 3.0 release (3 yrs ago) that caused problems with 
the XMLLogger.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=80435
This is fixed in Eclipse 3.1 and newer.

You can add additional listeners, just not change the logger.

Thanks
Darins
http://www.runnerwhocodes.blogspot.com/




Steve Loughran <st...@apache.org> 
11/06/2007 04:08 AM
Please respond to
"Ant Users List" <us...@ant.apache.org>


To
Ant Users List <us...@ant.apache.org>
cc

Subject
Re: Headless Ant: problems with loggers and listeners






Gabriele Bodda wrote:
> Hi, I've found one more element.
> 
> I got exactly the same error if I launch Ant through Eclipse with ANY
> listener, even with "-listener org.apache.tools.ant.XmlLogger" that 
happens
> to be cited even in the Ant manual.
> 
> To be more precise: it seems like the parameter -listener doesn't work 
when
> you launch Ant from INSIDE Eclipse (Run -> Ant Build...) or as an 
Eclipse
> application (at the end, it should be the same...)
> 
> So, it isn't directly related to CC (if I run "ant" from the command 
line it
> works fine even with all the CC listeners and loggers), but I need it 
fixed
> if I want to use CC with my build script... Any ideas? It seems really
> strange to me that you can't use the -listener parameter when you run a
> build inside eclipse!
> 
> Thanks,
> Gab


this isnt that strange, its the same for all the IDES. Ants 
listener/logger /input services are there to glue ant's IO with the 
outside world. When you build under eclipse, you get everything 
happening under the IDE. If you could switch logger, everything would 
break.

This isnt an ant feature, it will be the IDE stripping out any -listener 
options before it gets down to ant.

-tseve

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

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



Re: Headless Ant: problems with loggers and listeners

Posted by Steve Loughran <st...@apache.org>.
Gabriele Bodda wrote:
> Hi, I've found one more element.
> 
> I got exactly the same error if I launch Ant through Eclipse with ANY
> listener, even with "-listener org.apache.tools.ant.XmlLogger" that happens
> to be cited even in the Ant manual.
> 
> To be more precise: it seems like the parameter -listener doesn't work when
> you launch Ant from INSIDE Eclipse (Run -> Ant Build...) or as an Eclipse
> application (at the end, it should be the same...)
> 
> So, it isn't directly related to CC (if I run "ant" from the command line it
> works fine even with all the CC listeners and loggers), but I need it fixed
> if I want to use CC with my build script... Any ideas? It seems really
> strange to me that you can't use the -listener parameter when you run a
> build inside eclipse!
> 
> Thanks,
> Gab


this isnt that strange, its the same for all the IDES. Ants 
listener/logger /input services are there to glue ant's IO with the 
outside world. When you build under eclipse, you get everything 
happening under the IDE. If you could switch logger, everything would break.

This isnt an ant feature, it will be the IDE stripping out any -listener 
options before it gets down to ant.

-tseve

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

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


Re: Headless Ant: problems with loggers and listeners

Posted by Gabriele Bodda <g....@gmail.com>.
Hi, I've found one more element.

I got exactly the same error if I launch Ant through Eclipse with ANY
listener, even with "-listener org.apache.tools.ant.XmlLogger" that happens
to be cited even in the Ant manual.

To be more precise: it seems like the parameter -listener doesn't work when
you launch Ant from INSIDE Eclipse (Run -> Ant Build...) or as an Eclipse
application (at the end, it should be the same...)

So, it isn't directly related to CC (if I run "ant" from the command line it
works fine even with all the CC listeners and loggers), but I need it fixed
if I want to use CC with my build script... Any ideas? It seems really
strange to me that you can't use the -listener parameter when you run a
build inside eclipse!

Thanks,
Gab



On 11/2/07, Gabriele Bodda <g....@gmail.com> wrote:
>
> Hi all,
>
> my name is Gabriele, I'm trying to automate my build process using
> CruiseControl but I'm currently experiencing some critical problems with the
> Ant command it generates.
>
> Our project is developed using WebSphere Integration Developer (you know,
> IBM-enhanced Eclipse), under Windows XP Professional.
> My Ant script is quite standard, but it uses some of the custom tasks that
> come inside the IDE plugins, such as "workspaceBuild" or "exportEar" .
>
> I've read into the documentation that, in order to get access to the
> resources required by this kind of build script, I need to configure CC to
> start Ant externally via java. I have therefore written a customized
> runAnt.bat, and from the logs I see that the complete command launched by
> CC is this:
>
> "D:\Programmi\IBM\Rational\SDP\6.0\eclipse\jre\bin\java"
> -cp "D:\Programmi\IBM\Rational\SDP\6.0\eclipse\startup.jar"
> org.eclipse.core.launcher.Main
> -application com.ibm.etools.j2ee.ant.RunAnt
> -data "D:\Temp\CC\checkout"
> -logger net.sourceforge.cruisecontrol.builders.AntProgressXmlLogger
> -listener net.sourceforge.cruisecontrol.builders.AntOutputLogger
> -listener net.sourceforge.cruisecontrol.builders.AntProgressXmlListener
> -DXmlLogger.file=log.xml
> -lib D:\Programmi\CruiseControl\lib\cruisecontrol-antprogresslogger.jar
> -debug
> -Dcclastbuildtimestamp=20071029000000
> -Dbuildforced=false
> -Dlabel=build.1
> -Dcclastgoodbuildtimestamp=20071029000000
> -Dlastbuildsuccessful=false
> "-Dcvstimestamp=2007-11-01 21:29:04 GMT"
> -Dprojectname=Pagamenti
> -Dcctimestamp=20071101222904
> -buildfile build.xml build
>
> Do you see anything wrong in it? The point is that it doesn't work, not
> only when CC launches it, but also if I launch it manually (and this why I
> came here looking for help...)
> Moreover, it doesn't tell me anything useful to undestand what's wrong.
>
> An important fact I'd like to point out to you is that everything works
> well if I launch the same command without these parameters:
>
> -logger net.sourceforge.cruisecontrol.builders.AntProgressXmlLogger
> -listener net.sourceforge.cruisecontrol.builders.AntOutputLogger
> -listener net.sourceforge.cruisecontrol.builders.AntProgressXmlListener
> -DXmlLogger.file=log.xml
> -lib D:\Programmi\CruiseControl\lib\cruisecontrol- antprogresslogger.jar
>
> Does this tell you anything already, maybe a known problem or a common
> pitfall?
> In case not, please tell me what information you need to try to help me,
> because I'm really short of ideas.
>
> Thank you very much for your help,
> Gabriele
>