Maven Site Plugin
  1. Maven Site Plugin
  2. MSITE-54

In parent site, automatically create link to modules sites and vice-versa

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      6

      Description

      Say we have the following project structure :

      A
      +-- B
      +-- C
      +-- D

      It would be nice to have the following links in the left menu of the generated sites :

      A :
      Modules : B, D

      B :
      Parent : A
      Modules : C

      C :
      Parent : B

      D :
      Parent : A

      1. MNG-661.diff
        28 kB
        Vincent Siveton
      2. MNG-661.diff
        20 kB
        Vincent Siveton
      3. SiteMojoPatch.txt
        9 kB
        John Allen
      4. SiteMojoPatch.txt
        10 kB
        John Allen
      5. SiteMojoPatch.txt
        10 kB
        John Allen

        Issue Links

          Activity

          Hide
          Vincent Siveton added a comment -

          Applied. Thanks John!

          Show
          Vincent Siveton added a comment - Applied. Thanks John!
          Hide
          patrick OShea added a comment -

          Hi,

          I've been trying to get the parent and child projects linked from the site.
          Luckily you've already done all the work.
          I did make a few small changes to default to the getModulesMenu() and getProjectParentMenu()
          reporting output directory for if the parent\child urls are not set.
          If you would like the changes I can upload a diff of the changes

          Patrick

          Show
          patrick OShea added a comment - Hi, I've been trying to get the parent and child projects linked from the site. Luckily you've already done all the work. I did make a few small changes to default to the getModulesMenu() and getProjectParentMenu() reporting output directory for if the parent\child urls are not set. If you would like the changes I can upload a diff of the changes Patrick
          Hide
          John Allen added a comment -

          re the patch,

          theres a bug in the SiteStageMojo::getStructure() method under windows.

          Windows distribution paths can start with drive prefixes and thus we need to sanitize the ':' as its illegal in the newly generated compound path.

          Dont have a patch as this is a patch on a patch with no revision to compare against but starting at line 157:-

          Repository repository = new Repository( site.getId(), site.getUrl() );
          if ( StringUtils.isEmpty( repository.getBasedir() ) )

          { return repository.getHost(); }

          // might need to sanitize a drive letter under windows (eg. D:)

          String baseDir = repository.getBasedir();

          if ( baseDir.charAt(1) == ':' )
          {
          StringBuffer buffer = new StringBuffer();
          buffer.append( baseDir.charAt( 0 ) );

          if ( baseDir.length() > 3 )

          { buffer.append( baseDir.substring( 2 ) ); }

          baseDir = buffer.toString() ;

          System.out.println( "new baseDir = " + baseDir );
          }

          if ( baseDir.startsWith( "/" ) )

          { return repository.getHost() + baseDir; }
          Show
          John Allen added a comment - re the patch, theres a bug in the SiteStageMojo::getStructure() method under windows. Windows distribution paths can start with drive prefixes and thus we need to sanitize the ':' as its illegal in the newly generated compound path. Dont have a patch as this is a patch on a patch with no revision to compare against but starting at line 157:- Repository repository = new Repository( site.getId(), site.getUrl() ); if ( StringUtils.isEmpty( repository.getBasedir() ) ) { return repository.getHost(); } // might need to sanitize a drive letter under windows (eg. D:) String baseDir = repository.getBasedir(); if ( baseDir.charAt(1) == ':' ) { StringBuffer buffer = new StringBuffer(); buffer.append( baseDir.charAt( 0 ) ); if ( baseDir.length() > 3 ) { buffer.append( baseDir.substring( 2 ) ); } baseDir = buffer.toString() ; System.out.println( "new baseDir = " + baseDir ); } if ( baseDir.startsWith( "/" ) ) { return repository.getHost() + baseDir; }
          Hide
          John Allen added a comment -

          Additionall problem with new staging functionality and accessing uninterpolated parent project attributes.

          project.getParent() returns a project that has not been 'cooked' and thus contains uninterpolated expressions (e.g. $

          {my.var}

          )

          we need to use the reactor projects to find the parent as these have been properly processed.

          Show
          John Allen added a comment - Additionall problem with new staging functionality and accessing uninterpolated parent project attributes. project.getParent() returns a project that has not been 'cooked' and thus contains uninterpolated expressions (e.g. $ {my.var} ) we need to use the reactor projects to find the parent as these have been properly processed.
          Hide
          Brett Porter added a comment -

          John - please create a new issue for your staging site problems

          Show
          Brett Porter added a comment - John - please create a new issue for your staging site problems

            People

            • Assignee:
              Vincent Siveton
              Reporter:
              Yann Le Du
            • Votes:
              15 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: