Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logging output with spawn="true" using exec

 
Herman Chung
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Herman Chung
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi 'Flex Coder', please see your PM for an important admin message!
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic