Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] How to execute a MavenExecutionRequest

Thanks Fred.
Using callable do the work.



2015-10-01 15:21 GMT+02:00 Fred Bricon <fbricon@xxxxxxxxx>:

On Thu, Oct 1, 2015 at 9:03 AM, Romain Bioteau <romain.bioteau@xxxxxxxxxxxxxx> wrote:
Hi,
I'm new to m2e development. I intend to integrate m2e in our company rcp.
What I want to achieve is a "simple" mvn install:install-file.

Here is a snippet of what I do:

        final DefaultMavenExecutionRequest defaultMavenExecutionRequest = new DefaultMavenExecutionRequest();
        defaultMavenExecutionRequest.setGoals(Lists.newArrayList("install:install-file"));
        defaultMavenExecutionRequest.setInteractiveMode(false);

        final Properties properties = new Properties();
        properties.setProperty("file", artifact.getFile().getAbsolutePath());
        properties.setProperty("groupId", artifact.getGroupId());
        properties.setProperty("artifactId", artifact.getArtifactId());
        properties.setProperty("version", artifact.getVersion());
        properties.setProperty("packaging", artifact.getType());
        properties.setProperty("generatePom", String.valueOf(generatePom));
        defaultMavenExecutionRequest.setSystemProperties(properties);

        return MavenPlugin.getMaven().execute(defaultMavenExecutionRequest, new NullProgressMonitor());


It works. But the execute(MavenExecutionRequest,IProgressMonitor) is deprecated in the version I use (1.5.x).
I can't find how to properly do that in sources.

Thanks for the help.
Regards
 
--

Romain Bioteau
R&D engineer
romain.bioteau@xxxxxxxxxxxxxx
romain.bioteau
rbioteau
 
 
This message and any attachment (the "message") is intended solely for the addressees and is confidential. If you receive this message by mistake, please delete it and notify the sender immediately. Any use not in accordance with its purpose, any out-spread or disclosure, either as a whole or partially, is prohibited except with formal approval. Internet cannot guarantee the integrity of this message, therefore Bonitasoft will not be liable for the message if modified.
 


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



--
"Have you tried turning it off and on again" - The IT Crowd
And if that fails, then http://goo.gl/tnBgH5

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



--

Romain Bioteau
R&D engineer
romain.bioteau@xxxxxxxxxxxxxx
romain.bioteau
rbioteau
 
 
This message and any attachment (the "message") is intended solely for the addressees and is confidential. If you receive this message by mistake, please delete it and notify the sender immediately. Any use not in accordance with its purpose, any out-spread or disclosure, either as a whole or partially, is prohibited except with formal approval. Internet cannot guarantee the integrity of this message, therefore Bonitasoft will not be liable for the message if modified.
 


Back to the top