'In Maven Site how do I add a external href (to another root domain) in a menu item
I am trying to use the Maven Site archetype to generate a few sites. I want to have a menu section (called "Quick Links" for now) that has a number of common sites that users of this website might like to get to. It works as long as the domain of the target is the same as the top part of the domain for the site but not when it is a different top two domain parts.
This is a new maven project created with
mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-site -DarchetypeVersion=1.4
<menu name="Quick Links">
<item name="Public Web" href="https://www.mdtsoft.com/"/>
<item name="Closed Web" href="https://www.mdt-software.com/closed"/>
<item name="MDT Link" href="https://link.mdtsoft.com/alex"/>
<item name="Web Sandbox" href="https://sand-1.mdtsoft.com/"/>
</menu>
I expected all links to work (on a site at ident-prs9.mdtsoft.com
) but
only those sites with domains ending in mdtsoft.com
work.
Note that all but the first are password protected sites but at least anyone can get to the login point.
The geneated HTML looks like
<li class="nav-header">Quick Links</li>
<li><a href="https://www.mdtsoft.com/" class="externalLink" title="Public Web"><span class="none"></span>Public Web</a></li>
<li><a href="closed" title="Closed Web"><span class="none"></span>Closed Web</a></li>
<li><a href="https://link.mdtsoft.com/alex" class="externalLink" title="MDT Link"><span class="none"></span>MDT Link</a></li>
<li><a href="https://sand-1.mdtsoft.com/" class="externalLink" title="Web Sandbox"><span class="none"></span>Web Sandbox</a></li>
Note that the incorrect link no longer has anything but appears to be trying to make the link relative, Is there a way to force Maven to not change a href?
Solution 1:[1]
I believe you want to disable relativization of links with the setting
<relativizeDecorationLinks>false</relativizeDecorationLinks>
https://maven.apache.org/plugins/maven-site-plugin/site-mojo.html#relativizeDecorationLinks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | J. Dimeo |