Hi,

thanks for this.

I was actually able to achieve the 2nd task using the following:

                File sourcePom = getSourcePom(artifact);
                Properties userProps = new Properties();
                userProps.put("outputDirectory", dest.toString());
                MavenExecutionRequest request = 
MavenPlugin.getMaven().createExecutionRequest(null)
                                .setBaseDirectory(dest.toFile())
                                .setPom(sourcePom)
                                .setUserProperties(userProps)
                                
.setGoals(Collections.singletonList("dependency:copy-dependencies"));
                MavenPlugin.getMaven().execute(request, null);

The one thing I don’t like in the above is relying on obsolete stuff.
I tried using MavenExecutionContext, but could not understand how to achieve 
the above with it.
Any clue?

Eric

> Le 11 janv. 2017 à 01:41, Sandip Chitale <sandipchit...@gmail.com> a écrit :
> 
> Got it.
> 
> Maybe this can help.
> 
> https://github.com/sandipchitale/m2e-phasesandgoals/tree/master/org.eclipse.m2e.core.ui.phasesandgoals/src/org/eclipse/m2e/core/ui/internal/handlers
>  
> <https://github.com/sandipchitale/m2e-phasesandgoals/tree/master/org.eclipse.m2e.core.ui.phasesandgoals/src/org/eclipse/m2e/core/ui/internal/handlers>
> 
> I use some APIs exposed by m2e.
> 
> Cheers,
> Sandip
> 
> 
> On Tue, Jan 10, 2017 at 8:46 AM, Eric Vergnaud <eric.vergn...@wanadoo.fr 
> <mailto:eric.vergn...@wanadoo.fr>> wrote:
> Hi,
> 
> thanks for the suggestion.
> Not sure this helps. I’m looking to « extend »  my plugin with m2eclipse, not 
> extend m2eclipse with my plugin…
> My main concern is really around the concept of using m2eclipse with a pom 
> unrelated to the project, and without impacting the project.
> 
> Eric
> 
> 
>> Le 11 janv. 2017 à 00:34, Sandip Chitale <sandipchit...@gmail.com 
>> <mailto:sandipchit...@gmail.com>> a écrit :
>> 
>> Hi Eric,
>> 
>> Have you looked at this:
>> 
>> https://www.eclipse.org/m2e/documentation/m2e-extension-development.html 
>> <https://www.eclipse.org/m2e/documentation/m2e-extension-development.html>
>> 
>> HTH,
>> Sandip
>> 
>> On Tue, Jan 10, 2017 at 7:41 AM, Eric Vergnaud <eric.vergn...@wanadoo.fr 
>> <mailto:eric.vergn...@wanadoo.fr>> wrote:
>> Hi,
>> 
>> from an Eclipse plugin I’m writing, I need to invoke: mvn dependency:get and 
>> dependency:copy-dependencies.
>> Rather than require an mvn binary install, I’m thinking of adding m2eclipse 
>> to my plugin dependencies, and perform the equivalent through direct calls 
>> to m2eclipse.
>> I have no idea whether this is feasible or not, and how difficult it might 
>> be. The downloaded dependencies would be unrelated to the Eclipse project, 
>> so not sure if this makes sense.
>> What do you think?
>> Any high level guidance on how to achieve this?
>> 
>> Eric
>> 
>> 
>> _______________________________________________
>> m2e-users mailing list
>> m2e-users@eclipse.org <mailto:m2e-users@eclipse.org>
>> To change your delivery options, retrieve your password, or unsubscribe from 
>> this list, visit
>> https://dev.eclipse.org/mailman/listinfo/m2e-users 
>> <https://dev.eclipse.org/mailman/listinfo/m2e-users>
>> _______________________________________________
>> m2e-users mailing list
>> m2e-users@eclipse.org <mailto:m2e-users@eclipse.org>
>> To change your delivery options, retrieve your password, or unsubscribe from 
>> this list, visit
>> https://dev.eclipse.org/mailman/listinfo/m2e-users 
>> <https://dev.eclipse.org/mailman/listinfo/m2e-users>
> 
> _______________________________________________
> m2e-users mailing list
> m2e-users@eclipse.org <mailto:m2e-users@eclipse.org>
> To change your delivery options, retrieve your password, or unsubscribe from 
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/m2e-users 
> <https://dev.eclipse.org/mailman/listinfo/m2e-users>
> 
> _______________________________________________
> m2e-users mailing list
> m2e-users@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe from 
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/m2e-users

_______________________________________________
m2e-users mailing list
m2e-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users

Reply via email to