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

Fixing the order of items in "Modules" menu

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.3, 3.0
    • Component/s: multi module
    • Labels:
      None
    • Number of attachments :
      1

      Description

      Currently, it is impossible to influence the order in which the "Modules" show up in a generated site's menu when including them like this in the site descriptor:

      <menu ref="modules"/>

      As far as I can tell, the order of items in the menu depends on the order in which Maven builds the modules – and this does not always put the most important module at the top of the list. In fact, the top of the list is in all likelihood occupied by various low-level infrastructure modules; the high-level, user-visible modules typically come much later.

      This also means that the order of menu items depends on the module's dependencies; thus, this can result in unforeseen changes to the site when one module's build changes. Why doesn't Maven simply use the order of the module elements? That would be simple and predictable.

        Issue Links

          Activity

          Hide
          Lukas Theussl added a comment -

          The order of items in the generated menu is the same as the order of <module> elements in your pom.

          This also means that the order of menu items depends on the module's dependencies;

          I don't understand, why?

          Show
          Lukas Theussl added a comment - The order of items in the generated menu is the same as the order of <module> elements in your pom. This also means that the order of menu items depends on the module's dependencies; I don't understand, why?
          Hide
          Andreas Sewe added a comment -

          No, as far as I can tell, the menu items are ordered with respect to the reactor build order, not with respect to the order of elements in the pom.xml. (I just tested this with Maven 3.0.1 and the version 3.0-beta-3 of the maven-site-plugin.) In general, the these two coincide only during --non-recursive builds.

          Show
          Andreas Sewe added a comment - No, as far as I can tell, the menu items are ordered with respect to the reactor build order, not with respect to the order of elements in the pom.xml . (I just tested this with Maven 3.0.1 and the version 3.0-beta-3 of the maven-site-plugin .) In general, the these two coincide only during --non-recursive builds.
          Hide
          Dennis Lundberg added a comment -

          Andreas, you indicated when you created the issue that it affects version 2.1 of the Site Plugin. Is that correct or is this issue only for the 3.0 version of the Site Plugin together with Maven 3?

          Show
          Dennis Lundberg added a comment - Andreas, you indicated when you created the issue that it affects version 2.1 of the Site Plugin. Is that correct or is this issue only for the 3.0 version of the Site Plugin together with Maven 3?
          Hide
          Andreas Sewe added a comment -

          I made the original report when using Maven 2 and version 2.1 of the maven-site-plugin. Since then I have moved on to Maven 3 and the corresponding version of plugin; alas, the problem persists. (If you have problems reproducing it, I'll attach a sample project – but not tonight anymore)

          Show
          Andreas Sewe added a comment - I made the original report when using Maven 2 and version 2.1 of the maven-site-plugin . Since then I have moved on to Maven 3 and the corresponding version of plugin; alas, the problem persists. (If you have problems reproducing it, I'll attach a sample project – but not tonight anymore)
          Hide
          Dennis Lundberg added a comment -

          OK thanks.

          A sample project would be much appreciated.

          Show
          Dennis Lundberg added a comment - OK thanks. A sample project would be much appreciated.
          Hide
          Andreas Sewe added a comment -

          Despite the <module> ordering of first, second the order of menu items generated upon a mvn clean install site reflects the reactor build order:

          [INFO] Reactor Build Order:
          [INFO]
          [INFO] Has modules list
          [INFO] Should be second in Modules list
          [INFO] Should be first in Modules list

          (Tested using Maven 3.0.1 and 2.2.1; if you want to use the latter, remove the pluginManagment section in the aggregator POM.)

          Show
          Andreas Sewe added a comment - Despite the <module> ordering of first , second the order of menu items generated upon a mvn clean install site reflects the reactor build order: [INFO] Reactor Build Order: [INFO] [INFO] Has modules list [INFO] Should be second in Modules list [INFO] Should be first in Modules list (Tested using Maven 3.0.1 and 2.2.1; if you want to use the latter, remove the pluginManagment section in the aggregator POM.)
          Hide
          Lukas Theussl added a comment -

          Thanks for the test. Should be fixed with MSHARED-173.

          Show
          Lukas Theussl added a comment - Thanks for the test. Should be fixed with MSHARED-173 .
          Hide
          Andreas Sewe added a comment -

          Another side effect of using the reactor to determine the menu order (bit me today with 3.0-beta-3) is that the use of the resume-from option leads to incomplete "Modules" menus; this makes said option sadly unusable. So fixing this issue was more than a merely cosmetic change.

          Show
          Andreas Sewe added a comment - Another side effect of using the reactor to determine the menu order (bit me today with 3.0-beta-3) is that the use of the resume-from option leads to incomplete "Modules" menus; this makes said option sadly unusable. So fixing this issue was more than a merely cosmetic change.
          Hide
          Herve Boutemy added a comment -

          Andreas, can you open another issue with this problem?

          Show
          Herve Boutemy added a comment - Andreas, can you open another issue with this problem?
          Hide
          Andreas Sewe added a comment -

          What for? Wasn't it fixed in the current 3.0-beta-4-SNAPSHOT?

          Show
          Andreas Sewe added a comment - What for? Wasn't it fixed in the current 3.0-beta-4-SNAPSHOT?
          Hide
          Lukas Theussl added a comment -

          Herve: checking the attached test project with published site-plugin-2.3, the reactor build order is still second-first, but the order in the Modules menu of the generated site is first-second. So I consider this issue fixed.

          Show
          Lukas Theussl added a comment - Herve: checking the attached test project with published site-plugin-2.3, the reactor build order is still second-first, but the order in the Modules menu of the generated site is first-second. So I consider this issue fixed.
          Hide
          Lukas Theussl added a comment -

          I added the test project as an IT: r1126918

          Show
          Lukas Theussl added a comment - I added the test project as an IT: r1126918

            People

            • Assignee:
              Lukas Theussl
              Reporter:
              Andreas Sewe
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: