You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by De Smet Ringo <Ri...@staff.telenet.be> on 2008/12/23 17:03:41 UTC

Invoking maven in a plugin?

Hello,
 
We have a custom plugin that, for some functionality, spawns Maven again but with other arguments. The current implementation depends on the MavenExecutor from the maven-release-plugin:2.0-beta-4. I updated the dependency to 2.0-beta-8, but in there, the API to MavenExecutor has changed to include ReleaseEnvironment and ReleaseResult arguments. I don't want to delve any further in how I could get access to such objects since I'm running the MavenExecutor outside the release context.
 
What is the best way for a plugin to spawn Maven again in a subprocess? If there is any existing code, can you give me a pointer to it, or provide me with an example? I bumped into the maven-maven-plugin from geronimo.apache.org but they just use Ant to perform an exec task specifying the mvn command line again. I was hoping there is a more intelligent solution.
 
Thanks,
 
Ringo

*************************************************************

Dit e-mail bericht inclusief eventuele ingesloten bestanden kan informatie bevatten die vertrouwelijk is en/of beschermd door intellectuele eigendomsrechten. Dit bericht is uitsluitend bestemd voor de geadresseerde(n). Elk gebruik van de informatie vervat in dit bericht (waaronder de volledige of gedeeltelijke reproductie of verspreiding onder elke vorm) door andere personen dan de geadresseerde(n) is verboden. Indien u dit bericht per vergissing heeft ontvangen, gelieve de afzender hiervan te verwittigen en dit bericht te verwijderen. 

This e-mail and any attachment thereto may contain information which is confidential and/or protected by intellectual property rights and are intended for the sole use of the addressees. Any use of the information contained herein (including but not limited to total or partial reproduction or distribution in any form) by other persons than the addressees is prohibited. If you have received this e-mail in error, please notify the sender and delete its contents.

Ce courriel et les annexes �ventuelles peuvent contenir des informations confidentielles et/ou prot�g�es par des droits de propri�t� intellectuelle. Ce message est adress� exclusivement � son (ses) destinataire(s). Toute utilisation du contenu de ce message (y compris la reproduction ou diffusion partielle ou compl�te sous toute forme) par une autre personne que le(s) destinataire(s) est formellement interdite. Si vous avez re�u ce message par erreur, veuillez pr�venir l'exp�diteur du message et en d�truire le contenu.

*************************************************************

Re: Invoking maven in a plugin?

Posted by Stephen Connolly <st...@gmail.com>.
have a look at maven-invoker which is used by the maven-invoker-plugin

2008/12/23 De Smet Ringo <Ri...@staff.telenet.be>

> Hello,
>
> We have a custom plugin that, for some functionality, spawns Maven again
> but with other arguments. The current implementation depends on the
> MavenExecutor from the maven-release-plugin:2.0-beta-4. I updated the
> dependency to 2.0-beta-8, but in there, the API to MavenExecutor has changed
> to include ReleaseEnvironment and ReleaseResult arguments. I don't want to
> delve any further in how I could get access to such objects since I'm
> running the MavenExecutor outside the release context.
>
> What is the best way for a plugin to spawn Maven again in a subprocess? If
> there is any existing code, can you give me a pointer to it, or provide me
> with an example? I bumped into the maven-maven-plugin from
> geronimo.apache.org but they just use Ant to perform an exec task
> specifying the mvn command line again. I was hoping there is a more
> intelligent solution.
>
> Thanks,
>
> Ringo
>
> *************************************************************
>
> Dit e-mail bericht inclusief eventuele ingesloten bestanden kan informatie
> bevatten die vertrouwelijk is en/of beschermd door intellectuele
> eigendomsrechten. Dit bericht is uitsluitend bestemd voor de
> geadresseerde(n). Elk gebruik van de informatie vervat in dit bericht
> (waaronder de volledige of gedeeltelijke reproductie of verspreiding onder
> elke vorm) door andere personen dan de geadresseerde(n) is verboden. Indien
> u dit bericht per vergissing heeft ontvangen, gelieve de afzender hiervan te
> verwittigen en dit bericht te verwijderen.
>
> This e-mail and any attachment thereto may contain information which is
> confidential and/or protected by intellectual property rights and are
> intended for the sole use of the addressees. Any use of the information
> contained herein (including but not limited to total or partial reproduction
> or distribution in any form) by other persons than the addressees is
> prohibited. If you have received this e-mail in error, please notify the
> sender and delete its contents.
>
> Ce courriel et les annexes éventuelles peuvent contenir des informations
> confidentielles et/ou protégées par des droits de propriété intellectuelle.
> Ce message est adressé exclusivement à son (ses) destinataire(s). Toute
> utilisation du contenu de ce message (y compris la reproduction ou diffusion
> partielle ou complète sous toute forme) par une autre personne que le(s)
> destinataire(s) est formellement interdite. Si vous avez reçu ce message par
> erreur, veuillez prévenir l'expéditeur du message et en détruire le contenu.
>
> *************************************************************
>

Re: Invoking maven in a plugin?

Posted by Benjamin Bentmann <be...@udo.edu>.
De Smet Ringo wrote:

> What is the best way for a plugin to spawn Maven again in a subprocess?

http://maven.apache.org/shared/maven-invoker/

> If there is any existing code, can you give me a pointer to it, or provide me with an example?

http://maven.apache.org/plugins/maven-invoker-plugin/
http://maven.apache.org/plugins/maven-reactor-plugin/

There exists another executor in the Maven Release Manager that also 
uses the Maven Invoker.


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org