Maven Site plugin: how does menu inheritance work?

If I have a multi-module project, how can I inherit a menu from my parent POM? Project Layout:

main <-- main project which just contains modules
   parent   <-- parent POM
   ext      <-- 3rd party code

I tried this in my parent site.xml:

<menu name="Projects">
   <item name="Main Project" href="${web-root}/" collapse="false">
      <item name="Parent POM" href="${web-root}/parent/" />
      <item name="3rd Party" href="${web-root}/ext/">
   </item>
</menu>

but in site.xml extI used:

<menu name="Projects" inherit="top" />

I get a menu, but no links.

I also tried to define the menu in the main project site.xml, but the result is the same.

+3
source share
1 answer

I noticed three things:

:. inherit site.xml POM, POM. site.xml POM , .

site.xml :

<menu name="Projects" inherit="top">
  <item ...>
  </item>
</menu>

site.xml : name= "".

:. :

site.xml :

<!-- Inherit this menu for sub modules. -->
<menu ref="parent" inherit="top" />

<!-- Inherit this menu for sub modules. -->
<menu name="Sub Modules" ref="modules" inherit="bottom" />

.

: , . "ext" , ext "main" "parent" pom.xml.

+3

Source: https://habr.com/ru/post/1758348/


All Articles