maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor Fedorenko (JIRA)" <>
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
             Project: Maven Plugin Testing
          Issue Type: Improvement
            Reporter: Igor Fedorenko

Reading MavenProjects and running Mojo requires quite a bit of boilerplate 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;


        MavenProject project = readMavenProject( basedir );
        MavenSession session = newMavenSession( project );
        MojoExecution execution = newMojoExecution( goal );
        lookupConfiguredMojo( session, execution ).execute();

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

View raw message