[ https://jira.codehaus.org/browse/MSITE-632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=296740#comment-296740 ]
Dennis Lundberg commented on MSITE-632: --------------------------------------- I've had a look at the proposed patch and have applied it locally to trunk. This does make several ITs fail, which I'm having a closer look at now. Here are the results when building with Maven 2.2.1: {noformat} [ERROR] The following builds failed: [ERROR] * MSITE-304\pom.xml [ERROR] * MSITE-322\pom.xml [ERROR] * MSITE-537\pom.xml [ERROR] * site-inheritance\pom.xml [ERROR] * site-skip\pom.xml [ERROR] * site-stage-deploy\pom.xml [ERROR] * top-parent-different-site\pom.xml {noformat} > <site> from child module ignored > -------------------------------- > > Key: MSITE-632 > URL: https://jira.codehaus.org/browse/MSITE-632 > Project: Maven 2.x and 3.x Site Plugin > Issue Type: Bug > Components: site:deploy > Affects Versions: 3.0 > Reporter: Kohsuke Kawaguchi > > In trying to deploy > https://github.com/kohsuke/windows-package-checker/tree/4658075119d6ce9e4d6b9975342bbbef477d5f50 > , I noticed that the <site> I specified in this POM is ignored and the one > specified in the parent is used instead. The same site deploys as expected > with Maven2 with the site plugin 2.0-beta-7. > Looking at the source code, I see that > {{SiteDeployMojo.getDeployRepositoryURL()}} uses {{getRootSite}} to determine > the site to deploy, which explains why my <site> definition is getting > ignored. > I believe the fix is to use the nearest site definition, not the one that's > closest to the root of the inheritance chain. That is, the {{getRootSite()}} > should be changed from: > {code} > 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 ); > try > { > site = getSite( parent ); > } > catch ( MojoExecutionException e ) > { > break; > } > } > return site; > } > {code} > to > {code} > protected Site getRootSite( MavenProject project ) > throws MojoExecutionException > { > Site site = getSite( project ); > MavenProject parent = project; > while ( site ==null && parent.getParent() != null ) > { > // MSITE-585, MNG-1943 > parent = siteTool.getParentProject( parent, reactorProjects, > localRepository ); > try > { > site = getSite( parent ); > } > catch ( MojoExecutionException e ) > { > break; > } > } > return site; > } > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira