[
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)