Re: [Fwd: Threads in a plug-in]

2009-10-29 Thread Brian Fox
Maven just exits when it's done and then the jdk pulls everything down. Isn't there a flag you can set on a thread to mark it as a daemon thread, and then the system waits before killing it? On Wed, Oct 28, 2009 at 9:20 AM, Gajo Csaba csaba.g...@cosylab.com wrote: Good idea! I was actually

Re: [Fwd: Threads in a plug-in]

2009-10-29 Thread James Russo
Hello, Actually it is the other way around. Daemon threads will not hold up JVM from exiting, but non-deamon threads will. Marks this thread as either a daemon thread or a user thread. The Java Virtual Machine exits when the only threads running are all daemon threads. The daemon flag will

Re: [Fwd: Threads in a plug-in]

2009-10-29 Thread Nick Stolwijk
I think Maven executes a System.exit at the end, which will terminate all threads, regardless of daemon state. With regards, Nick Stolwijk ~Java Developer~ IPROFS BV. Claus Sluterweg 125 2012 WS Haarlem http://www.iprofs.nl On Thu, Oct 29, 2009 at 1:09 PM, James Russo j...@halo3.net wrote:

Re: [Fwd: Threads in a plug-in]

2009-10-29 Thread Gajo Csaba
Which is the main class of maven? I found in org.apache.maven.cli.MavenCli this as the last line of the public static void main method, so maybe this is it: System.exit( result ); Regards, Csaba Nick Stolwijk wrote: I think Maven executes a System.exit at the end, which will terminate all

[Fwd: Threads in a plug-in]

2009-10-28 Thread Gajo Csaba
Hello all, Could someone please answer my question? I don't believe it's that complicated... Thanks, Csaba ---BeginMessage--- Hello, I've developed a plug-in which executes some shell commands. I would like to run these commands in parallel with the rest of the build process, because

Re: [Fwd: Threads in a plug-in]

2009-10-28 Thread Stephen Connolly
add a second goal the first goal will store some thread completion object in MavenSession or in a Class level static field When all threads are finished the completion object will be updated by the last thread The second goal blocks until the completion object is completed. Then add the second

Re: [Fwd: Threads in a plug-in]

2009-10-28 Thread Gajo Csaba
Good idea! I was actually hoping there was some switch I can set in Maven to tell it not to terminate my thread, but I guess your idea would work fine as well. Thanks! Csaba Stephen Connolly wrote: add a second goal the first goal will store some thread completion object in MavenSession or

Threads in a plug-in

2009-10-27 Thread Gajo Csaba
Hello, I've developed a plug-in which executes some shell commands. I would like to run these commands in parallel with the rest of the build process, because they don't affect the other files. So I was thinking of creating a thread in the execute() method, starting it, and let it do its