Multiproject independent navigation
-----------------------------------

         Key: MPDASHBOARD-24
         URL: http://jira.codehaus.org/browse/MPDASHBOARD-24
     Project: maven-dashboard-plugin
        Type: Bug
    Versions: 1.7    
 Environment: Maven 1.0.2
Windows XP
    Reporter: Wim Deblauwe


the Dashboard plugin seems to assume that the
maven.multiproject.navigation property is set to 'aggregate', becuase
the links that are generated are like this:

   <j:if test="${shallDisplay == 'true'}">
     <tr>
       <x:set var="projecturl1" select="string(@artifactId)"/>
       <j:set var="projecturl"
value="${maven.multiproject.aggregateDir}${projecturl1}/index.html"/>
       <td><a href="${projecturl}"><x:expr select="@name"/></a></td>
       <jsl:applyTemplates select="aggregator"/>
     </tr>
   </j:if>

Notice the use of maven.multiproject.aggregateDir. But when
'independent' navigation is used the plugin should look at the
'pom.url' property.

A solution for this:

In dashboard.jsl, in <jsl:template match="project">:

  <j:if test="${shallDisplay == 'true'}">
    <tr>
      <!-- url not defined in POM -->
      <x:set var="pomurl" select="string(@url)"/>
      <j:if test="${empty(pomurl)}">
        <x:set var="projecturl1" select="string(@artifactId)"/>
        <j:set var="projecturl"
value="${maven.multiproject.aggregateDir}${projecturl1}/index.html"/>
        <td><a href="${projecturl}"><x:expr select="@name"/></a></td>
      </j:if>

      <!-- url defined in POM -->
      <j:if test="${!empty(pomurl)}">
          <td><a href="${pomurl}"><x:expr select="@name"/></a></td>
       </j:if>
      <jsl:applyTemplates select="aggregator"/>
    </tr>
  </j:if>

In plugin.jelly, under the dashboard:aggregate goal:

           <x:element name="project">
             <x:attribute name="name">${reactorProject.name}</x:attribute>
             <x:attribute
name="artifactId">${reactorProject.artifactId}</x:attribute>
             <!-- start of my added code -->
             <j:if test="${!empty(reactorProject.url)}">
               <x:attribute name="url">${reactorProject.url}</x:attribute>
             </j:if>
              <!-- end of my added code -->
             ... rest of code
          </x:element>

Basically, this is what happens:

The pom.url is added to the dashboard-data.xml file. This url is then
retrieved in the jsl file via @url. If this @url is not empty, the
value of it is used to create the link.

Can somebody create a patch out of this and add it for the next version. Thanks!

regards,

Wim

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to