Andreas Sewe wrote:
Hi all,
I have the following two projects:
A dedicated website project for my root URL
org.example:site (with <url>http://example.org/</url>)
and an organizational POM
org.example:parent (with <url>http://example.org/parent</url>)
The parent of org.example:site is the organizational POM,
org.example:parent. Both projects have their own site.xml.
So far, I think, that's all according to Best Practices.
The trouble starts once I configure breadcrumbs. What I want to generate
are the following two breadcrumb trails:
Example.org Site
and
Example.org Site > Example.org Parent
for org.example:site and org.example:parent, respectively. Note that
these two trails do not mirror the project's inheritance tree, but
rather the users' expectations (org.example:site is the main website
artifact, after all).
But no matter what <breadcrumbs> I define in the site.xml of both
projects, I cannot get the desired effect. In particular, the following
doesn't work:
<!--org.example:parent's site.xml -->
<breadcrumbs>
<item name="Example.org Site" href=http://example.org/"/>
<item name="Example.org Parent" href=http://example.org/parent/"/>
</breadcrumbs>
<!--org.example:site's site.xml -->
<breadcrumbs>
<item name="Example.org Site" href=http://example.org/"/>
</breadcrumbs>
While the breadcrumbs of org.example:parent are correct, the trail of
org.example:site is simply too long:
Example.org Site > Example.org Parent
It's almost as if not merging occurred at all. But it gets worse:
If I change the site.xml of org.example:site just slightly, the
breadcrumb trail of org.example:site grows even longer:
<breadcrumbs>
<item name="Example.org *Main* Site" href=http://example.org/"/>
</breadcrumbs>
yields
Example.org Site > Example.org Parent > Example.org *Main* Site
Two things:
1) breadcrumbs always get appended, you cannot override or remove a
breadcrumb that has been added in a parent
2) identical breadcrumbs are ignored
In your first case above, you are trying to add the same breadcrumb
(same name, same href) again that is already defined in the parent, so
according to 2) it is ignored and you only get the parent breadcrumbs.
In your second case the child breadcrumb is appended according to 1) so
you get 3 (2 parent + 1 child) breadcrumbs.
This is the currently expected behavior. The fact that one cannot
override or remove breadcrumbs is annoying, you might want to file a
feature request for it.
HTH,
-Lukas
Can someone please explain to me what's going on here? To me, the
inheritance behavior of breadcrumbs looks rather random.
Best wishes,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org