You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jared Prestwich <jp...@accessdata.com> on 2010/10/28 01:41:48 UTC

using the CheckoutMojo in my own plugin

I'm writting a plugin that checks the dependencies and seperates my company
dependencies out. That works fine but now I would like to run a checkout on
those.
I have the connectionUrl set in the poms. I just need to call checkout.

I have tried getting an object of CheckoutMojo type but it always comes back
as a Null.
I thought maybe to bag that and just do a CommandLine call but I like the
idea of a universal scm plugin.

This is the latest iteration:

CheckoutMojo co = (CheckoutMojo) lookupCheckoutMojo();
...
co.execute();

protected Mojo lookupCheckoutMojo()
{
PlexusContainer container = new DefaultPlexusContainer();
container.initialize();
container.start();
return (Mojo) container.lookup( Mojo.ROLE,
"org.apache.maven.plugins:maven-scm-plugin:1.4:checkout");
}

Re: using the CheckoutMojo in my own plugin

Posted by Andreas Gies <an...@wayofquality.de>.
Hi there,

you may want to read through this thread: 
http://www.mail-archive.com/users@maven.apache.org/msg113122.html
I have done the same thing, but was using the Maven API to resolve the 
plugin rather than trying it via the container directly.

HTH
Andreas

Am 10/28/10 1:41 AM, schrieb Jared Prestwich:
> I'm writting a plugin that checks the dependencies and seperates my company
> dependencies out. That works fine but now I would like to run a checkout on
> those.
> I have the connectionUrl set in the poms. I just need to call checkout.
>
> I have tried getting an object of CheckoutMojo type but it always comes back
> as a Null.
> I thought maybe to bag that and just do a CommandLine call but I like the
> idea of a universal scm plugin.
>
> This is the latest iteration:
>
> CheckoutMojo co = (CheckoutMojo) lookupCheckoutMojo();
> ...
> co.execute();
>
> protected Mojo lookupCheckoutMojo()
> {
> PlexusContainer container = new DefaultPlexusContainer();
> container.initialize();
> container.start();
> return (Mojo) container.lookup( Mojo.ROLE,
> "org.apache.maven.plugins:maven-scm-plugin:1.4:checkout");
> }
>


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


Re: using the CheckoutMojo in my own plugin

Posted by Olivier Lamy <ol...@apache.org>.
Hi,
Why not simply use scm apis ? (you can have a look at the checkout
mojo to understand how it works).
The mojo is simply a kind of wrapper around the scm apis (all the
stuff is done in the scm apis).

2010/10/28 Jared Prestwich <jp...@accessdata.com>:
> I'm writting a plugin that checks the dependencies and seperates my company
> dependencies out. That works fine but now I would like to run a checkout on
> those.
> I have the connectionUrl set in the poms. I just need to call checkout.
>
> I have tried getting an object of CheckoutMojo type but it always comes back
> as a Null.
> I thought maybe to bag that and just do a CommandLine call but I like the
> idea of a universal scm plugin.
>
> This is the latest iteration:
>
> CheckoutMojo co = (CheckoutMojo) lookupCheckoutMojo();
> ...
> co.execute();
>
> protected Mojo lookupCheckoutMojo()
> {
> PlexusContainer container = new DefaultPlexusContainer();
> container.initialize();
> container.start();
> return (Mojo) container.lookup( Mojo.ROLE,
> "org.apache.maven.plugins:maven-scm-plugin:1.4:checkout");
> }
>



-- 
Olivier Lamy
http://twitter.com/olamy
http://www.linkedin.com/in/olamy

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