private MavenProject getProject( Artifact artifact )
throws MojoExecutionException
{
try
{
ProjectBuildingRequest request = new DefaultProjectBuildingRequest();
request.setLocalRepository( localRepository );
request.setRemoteRepositories( remoteRepositories );
request.setResolveDependencies( true );
ArrayList<String> ids = new ArrayList<String>();
for(Profile profile : project.getActiveProfiles()){
ids.add(profile.getId());
}
request.setActiveProfileIds(ids);
request.setRepositorySession( session.getRepositorySession() );
return projectBuilder.build( artifact, request ).getProject();
}
catch ( ProjectBuildingException e )
{
getLog().warn( "Failed to retrieve pom for " + artifact );