Skip to main content

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

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.
 


Back to the top