if ( version == null && candidateModel.getParent() != null )
{
version = candidateModel.getParent().getVersion();
}
Parent parent = childModel.getParent();
if ( groupId == null || !groupId.equals( parent.getGroupId() ) || artifactId == null
|| !artifactId.equals( parent.getArtifactId() ) )
{
StringBuilder buffer = new StringBuilder( 256 );
buffer.append( "'parent.relativePath'" );
if ( childModel != problems.getRootModel() )
{
buffer.append( " of POM " ).append( ModelProblemUtils.toSourceHint( childModel ) );
}
buffer.append( " points at " ).append( groupId ).append( ":" ).append( artifactId );
buffer.append( " instead of " ).append( parent.getGroupId() ).append( ":" ).append( parent.getArtifactId() );
buffer.append( ", please verify your project structure" );
problems.setSource( childModel );
problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.BASE )
.setMessage( buffer.toString() )
.setLocation( parent.getLocation( "" ) ) );
return null;
}
if ( version == null || !version.equals( parent.getVersion() ) )
{
return null;
}
ModelData parentData = new ModelData( candidateSource, candidateModel, groupId, artifactId, version );