maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor Fedorenko (JIRA)" <j...@codehaus.org>
Subject [jira] (MPLUGINTESTING-37) Provide convenince methods to work with MavenProject
Date Tue, 04 Feb 2014 17:21:57 GMT

     [ https://jira.codehaus.org/browse/MPLUGINTESTING-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Igor Fedorenko closed MPLUGINTESTING-37.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 3.1.0

Implemented

https://git-wip-us.apache.org/repos/asf?p=maven-plugin-testing.git;a=commit;h=6ac53b29a3557907607374c9fa81649d96a7f218

> Provide convenince methods to work with MavenProject
> ----------------------------------------------------
>
>                 Key: MPLUGINTESTING-37
>                 URL: https://jira.codehaus.org/browse/MPLUGINTESTING-37
>             Project: Maven Plugin Testing
>          Issue Type: Improvement
>            Reporter: Igor Fedorenko
>             Fix For: 3.1.0
>
>
> Reading MavenProjects and running Mojo requires quite a bit of boilerplate code
> {code}
>         File pom = new File( basedir, "pom.xml" );
>         MavenExecutionRequest request = new DefaultMavenExecutionRequest();
>         request.setBaseDirectory( basedir );
>         ProjectBuildingRequest configuration = request.getProjectBuildingRequest();
>         MavenProject project = lookup( ProjectBuilder.class ).build( pom, configuration
).getProject();
>         Assert.assertNotNull( project );
>         return project;
> {code}
> and
> {code}
>         MavenProject project = readMavenProject( basedir );
>         MavenSession session = newMavenSession( project );
>         MojoExecution execution = newMojoExecution( goal );
>         lookupConfiguredMojo( session, execution ).execute();
> {code}
> It would be convenient if these were available from MojoRule, such that the same code
could be reused by all maven plugins that use maven-plugin-testing.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Mime
View raw message