using multiple instance of maven on one build

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

using multiple instance of maven on one build

Marc-Andre Houle
While going through the code, I have found that using the "|" can be used to pipe different maven process....
I would like to use this to have separate profile for site report and packaging task in a  multi module maven project.
(deploy site site:deploy -PonlyCompilableModule | deploy -PonlyPackageableModule)

The problem I have found is that when the first instance fail (-PonlyCompilableModule), the second target is still called and the result of the build is "SUCCESS" .

Am I the only one with this problem?  Shouldn't the build fail completely when the first instance fail?

Thanks

Marc-Andre
Reply | Threaded
Open this post in threaded view
|

Re: using multiple instance of maven on one build

Kohsuke Kawaguchi
Administrator
Marc-Andre Houle wrote:

> While going through the code, I have found that using the "|" can be used to
> pipe different maven process....
> I would like to use this to have separate profile for site report and
> packaging task in a  multi module maven project.
> (deploy site site:deploy -PonlyCompilableModule | deploy
> -PonlyPackageableModule)
>
> The problem I have found is that when the first instance fail
> (-PonlyCompilableModule), the second target is still called and the result
> of the build is "SUCCESS" .
>
> Am I the only one with this problem?  Shouldn't the build fail completely
> when the first instance fail?
Looking at the code if any one of the Maven invocations return non-0
exit code Hudson will stop there and consider a build as a failure.

I think your Maven must be returning exit code 0 even for failed builds.
I believe someone reported earlier that recent versions of Maven
(perhaps even 2.0.7) has this bug on some platforms. Can you search the
archive of the ML?

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: using multiple instance of maven on one build

Marc-Andre Houle
You are right, I have made test on my computer running windows, and the build box is on Linux.  Finally, When tried on our live hudson build server, it worked fine.  

Sorry to have disturb you.

Marc

kohsuke wrote
Marc-Andre Houle wrote:
> While going through the code, I have found that using the "|" can be used to
> pipe different maven process....
> I would like to use this to have separate profile for site report and
> packaging task in a  multi module maven project.
> (deploy site site:deploy -PonlyCompilableModule | deploy
> -PonlyPackageableModule)
>
> The problem I have found is that when the first instance fail
> (-PonlyCompilableModule), the second target is still called and the result
> of the build is "SUCCESS" .
>
> Am I the only one with this problem?  Shouldn't the build fail completely
> when the first instance fail?

Looking at the code if any one of the Maven invocations return non-0
exit code Hudson will stop there and consider a build as a failure.

I think your Maven must be returning exit code 0 even for failed builds.
I believe someone reported earlier that recent versions of Maven
(perhaps even 2.0.7) has this bug on some platforms. Can you search the
archive of the ML?

--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi@sun.com