Uploaded image for project: 'Maven Site Plugin'
  1. Maven Site Plugin
  2. MSITE-632

<site> from child module ignored

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 3.0
    • None
    • site:deploy
    • None

    Description

      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:

          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;
          }
      

      to

          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;
          }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kohsuke Kohsuke Kawaguchi
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: