aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Logging output with spawn= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Logging output with spawn="true" using exec" Watch "Logging output with spawn="true" using exec" New topic
Author

Logging output with spawn="true" using exec

Herman Chung
Greenhorn

Joined: Jul 10, 2009
Posts: 2
Hi all,

I am trying to do continue integration w/ luntbuild and it requires ant to output "BUILD SUCCESS" or result==0 in order to declare the build is successful

The last step of my build is to start tomcat. I basically just use:



to start tomcat, here is the dilemma, if I dont use spawn="true" it will hang indefinately and luntbuild will eventually give up and declare build failed. On the other hand, if i use spawn="true" it will show build success, but the output is not actually logged (as per doucmentation in ant 1.7).

What can I really do for luntbuild to recognize that tomcat has started and be able to meet the success build condition. I appreciate any help guys, really stuck here
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Herman, welcome to Java Ranch!

When you say "but the output is not actually logged", which output do you mean? The output from Tomcat? If so, here is the description of the exec spawn attribute from the Ant 1.7.1 manual:


spawn
whether or not you want the command to be spawned
Default is false.
If you spawn a command, its output will not be logged by ant.
The input, output, error, and result property settings are not active when spawning a process.
since Ant 1.6


JBoss In Action
Herman Chung
Greenhorn

Joined: Jul 10, 2009
Posts: 2
thanks for the quick reply Peter!

Maybe I should reword my question. I think by using spawn="true", luntbuild somehow doesn't recognize "BUILD SUCCESSFUL" that was output by Ant. I am wondering if there is a way to know that tomcat has succesfully started in Ant without using spawn="true", because basically what ant will do is just hangs until tomcat is shutdown, then it will output "BUILD SUCCESSFUL".

Hope you can help me out Thanks!
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

This sounds like something specific to luntbuild, which I have never used (didn't even know such a thing existed). Maybe someone with experience with luntbuild can help.
Edwin Johnson
Greenhorn

Joined: Aug 17, 2009
Posts: 2
Did you ever find an answer to this problem? I am having a similar issue - I want Tomcat's startup to be logged to the console in Eclipse, and then after that I am executing a program, but the console output never finishes - I never see the "Build successful" message - I just see the Tomcat startup log - the rest of the ANT script doesn't go to the console.


Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi 'Flex Coder', please see your PM for an important admin message!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Edwin, welcome to Java Ranch.

Your question, while similar to the original poster's, is not the same. Please start a new topic. And when you do please post the Ant target in question and the last few lines of the output that you do see.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Logging output with spawn="true" using exec