* @throws MojoExecutionException if no site info is found in the tree.
*/
protected Site getRootSite( MavenProject project )
throws MojoExecutionException
{
Site site = getSite( project );
MavenProject parent = project;
while ( parent.getParent() != null )
{
// MSITE-585, MNG-1943
parent = siteTool.getParentProject( parent, reactorProjects, localRepository );
Site oldSite = site;
try
{
site = getSite( parent );
}
catch ( MojoExecutionException e )
{
break;
}
// MSITE-600
URIPathDescriptor siteURI = new URIPathDescriptor( URIEncoder.encodeURI( site.getUrl() ), "" );
URIPathDescriptor oldSiteURI = new URIPathDescriptor( URIEncoder.encodeURI( oldSite.getUrl() ), "" );
if ( !siteURI.sameSite( oldSiteURI.getBaseURI() ) )
{
return oldSite;
}