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 16:53:57 GMT
Igor Fedorenko created MPLUGINTESTING-37:
--------------------------------------------

             Summary: 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


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