DefaultModelProblemCollector problems )
throws ModelBuildingException
{
problems.setSource( childModel );
Parent parent = childModel.getParent();
String groupId = parent.getGroupId();
String artifactId = parent.getArtifactId();
String version = parent.getVersion();
ModelResolver modelResolver = request.getModelResolver();
if ( modelResolver == null )
{
throw new IllegalArgumentException( "no model resolver provided, cannot resolve parent POM "
+ ModelProblemUtils.toId( groupId, artifactId, version ) + " for POM "
+ ModelProblemUtils.toSourceHint( childModel ) );
}
ModelSource modelSource;
try
{
modelSource = modelResolver.resolveModel( groupId, artifactId, version );
}
catch ( UnresolvableModelException e )
{
StringBuilder buffer = new StringBuilder( 256 );
buffer.append( "Non-resolvable parent POM" );
if ( !containsCoordinates( e.getMessage(), groupId, artifactId, version ) )
{
buffer.append( " " ).append( ModelProblemUtils.toId( groupId, artifactId, version ) );
}
if ( childModel != problems.getRootModel() )
{
buffer.append( " for " ).append( ModelProblemUtils.toId( childModel ) );
}
buffer.append( ": " ).append( e.getMessage() );
if ( childModel.getProjectDirectory() != null )
{
if ( parent.getRelativePath() == null || parent.getRelativePath().length() <= 0 )
{
buffer.append( " and 'parent.relativePath' points at no local POM" );
}
else
{
buffer.append( " and 'parent.relativePath' points at wrong local POM" );
}
}
problems.add( Severity.FATAL, buffer.toString(), parent.getLocation( "" ), e );
throw problems.newModelBuildingException();
}
ModelBuildingRequest lenientRequest = request;
if ( request.getValidationLevel() > ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0 )