|
In my insolence (and haste?) I have decided to
generate my private version of the exec-plugin which accepts one more
parameter "spawn" and simply fires-off the process with
commandLine.execute() if the parameter "spawn" is set to true (instead
of using the blocking executeCommandLine). It "seems" to "work". I am sure this is a bad practice as I hasten to add that I am totally ignorant as to the community practices regarding modifications of the various Maven plugins for private use so I send this email simply as a polite reply to the thoughtful responses I received (and of which I am thankful). Menelaos. Wall, Steve wrote: Hello, It appears what you'd like to do is execute a process in the background or as a deamon type process. I didn't see anything in the exec documentation allowing this type of execution. It appears the exec commands does indeed wait of the completion of the command before continuing. Another idea creates a wrapper script around the command you want to execute and execute the wrapper script from maven. If you are on a *ix system, execute your command from the wrapper like this:#!/bin/bash java org.hsqldb.Server & == Possibly add checking ensuring the DB fired up properly == exit 0 <=== Could also exit with a variable set based on the proper starting of the DB # end script Notice the "&" starts the DB in the background. Just a thought. HTH, Steve -----Original Message----- From: Menelaos Perdikeas [mailto:[email protected]] Sent: Wednesday, January 27, 2010 6:43 AM To: [email protected] Subject: Re: [mojo-user] org.codehaus.mojo-exec-maven-plugin-1.1.1. exec goal hangs the mvn build Thanks for your prompt reply but I am afraid that unless I am missing something this won't do the trick. My application uses an external relational database (HSQLDB but could also be MySQL). So the integration testing requires my application to write information to a database instance and then retrieve the information and make some comparisons to make sure that everything played out nicely. To do that I need an external database server up and running _before_ the integration testing. In my example it is a database server but it could also have been another server my application needs to connect to (e.g. maybe a web service provider server). So what I need is to _spawn_ an external process as part of the pre-integration test phase. Looking at sql-maven-plugin I cannot see how I can possible accomplish that. Moreover this problem is part of a broader issue that hasn't got to do with databases in particular. What is the best way to setup in Maven your integration testing environment when your integration tests rely on external servers. I may be ignorant since I am new to Maven but from what I see the codehaus exec plugin is used for that purpose. However, if it cannot be instructed to "spawn" the external process it hangs the whole life cycle. Kuhtz, Andreas wrote:Maybe you should better use the sql-maven-plugin --> http://mojo.codehaus.org/sql-maven-plugin/examples/execute.html -----Original Message----- From: Menelaos Perdikeas [mailto:[email protected]] Sent: Mittwoch, 27. Januar 2010 14:04 To: [email protected] Subject: [mojo-user] org.codehaus.mojo-exec-maven-plugin-1.1.1. exec goal hangs the mvn build Hi, I am using the org.codehaus.mojo exec plugin version 1.1.1. (the"exec" -- Dr. -Ing. Menelaos Perdikeas Semantix Information Technologies email: [email protected] web : http://www.semantix.gr, http://www.tapeditor.com phone: (+30)210-6412065 fax : (+30)210-6412068 addr.: Konstantinou Tsaldari 62, 11476, Athens, GREECE--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
- [mojo-user] org.codehaus.mojo-exec-maven-plugin-1.1.1. ... Menelaos Perdikeas
- RE: [mojo-user] org.codehaus.mojo-exec-maven-plugi... Kuhtz, Andreas
- Re: [mojo-user] org.codehaus.mojo-exec-maven-p... Menelaos Perdikeas
- RE: [mojo-user] org.codehaus.mojo-exec-mav... Wall, Steve
- Re: [mojo-user] org.codehaus.mojo-exec... Menelaos Perdikeas
