try
{
ArtifactRepository localRepository = repositoryTool
.createLocalArtifactRepositoryInstance( localRepositoryBasedir );
ProjectBuildingRequest request = new DefaultProjectBuildingRequest();
return projectBuilder.build( pomFile, request ).getProject();
}
catch ( ProjectBuildingException e )
{
throw new TestToolsException( "Error building MavenProject instance from test pom: " + pomFile, e );