private MavenProject buildFromSourceFileInternal( File projectDescriptor,
ProjectBuilderConfiguration config,
boolean checkDistributionManagementStatus )
throws ProjectBuildingException
{
Model model = readModel( "unknown", projectDescriptor, true );
MavenProject project = buildInternal( projectDescriptor.getAbsolutePath(), model, config,
buildArtifactRepositories( getSuperModel() ), projectDescriptor,
true );
if ( checkDistributionManagementStatus )
{
if ( ( project.getDistributionManagement() != null ) &&
( project.getDistributionManagement().getStatus() != null ) )
{
String projectId = safeVersionlessKey( project.getGroupId(), project.getArtifactId() );
throw new ProjectBuildingException( projectId,
"Invalid project file: distribution status must not be specified for a project outside of the repository" );
}
}
return project;
}