We store sensitive information in our config files (db passwords and such), so 
we encrypt them. We have a client/server process that decrypts these passwords. 
The process is used by other projects, so it needs to live beyond the duration 
of its build. 

I'm running on Windows.

My test code is this:

Process p = Runtime.getRuntime().exec(
  "c:\\dev\\maven\\bin\\mvn.bat", 
  null,
  new File("c:\\depot\\s4\\s4-server"));
p.waitFor();

I don't think this is a continuum bug. I was just wondering if the wrapper does 
anything that would cause this to happen, such as attach some kind of listener 
to the jvm it starts which might prevent a process' input stream from closing 
when the process stops if the process has spawned an child processes. Shot in 
the dark, I know, but I've tried all the obvious things.

If anything, a change (I'd call it an improvement, but some might not) could be 
made to plexus. Specifically, in CommandLineUtils.executeCommandLine(), instead 
of calling wait() on the output and error stream pumpers, it should instead 
poll the pumpers to ask if they're blocked on the input/error stream, and, if 
so, manually close them.

> -----Original Message-----
> From: Emmanuel Venisse [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 12, 2006 1:33 AM
> To: [email protected]
> Subject: Re: Continuum hangs when building a Maven project that spawns a
> process
> 
> 
> John Didion a écrit :
> > We have a project that spawns a process (via Runtime.exec) that is
> > intended to live beyond the duration of the build. When Continuum builds
> > this project, the status is always "in progress".
> 
> Why do you have this? If the project live beyond the duration of the
> build, it isn't a test so it
> mustn't run in a continuum build.
> 
> >
> >
> >
> > The problem seems to be that the stream pumper that redirects the output
> > from maven hangs on in.readLine(), where in is a reader that wraps the
> > maven process' input stream. Apparently, the process' input stream never
> > closes (even though the jvm running maven exits after the build
> > completes) and the input stream's read method is blocking. If I manually
> > kill the process spawned by maven, then the input stream closes and the
> > build completes.
> 
> What is your OS?
> >
> >
> >
> > The interesting this is that if I write a simple java class to invoke
> > maven via Runtime.exec (in the same manner that continuum does via
> > plexus' Commandline class) and then call this from the command line,
> > everything works fine. We were also doing this exact same thing in an
> > ant build.xml via CruiseControl, and it worked fine.
> 
> Can you send us your simple java class? Do you think it's a bug in
> continuum code?
> 
> >
> >
> >
> > My hunch is that it has something to do with the wrapper program that is
> > used to invoke continuum.
> >
> >
> >
> > Continuum's process chain looks like this: wrapper->continuum
> > jvm->maven->longrunningprocess
> >
> > CruiseControl's process chain looks like this: cruise control jvm->build
> > loop thread->ant->longrunningprocess
> >
> >
> >
> > Does anyone have any idea why this would be, and, more importantly, how
> > I can work around it?
> >
> >

Reply via email to