Hi,

Following on from this and other Project Reports, I have been tweaking the
xdoc plugin so that the Project Reports can be added dynamically.

My method was as follows:

1) added a new class o.a.m.project.ProjectReport with attributes name,
description, href

2) modified o.a.m.project.Project to have a collection of ProjectReport
objects

3) added following method to o.a.m.project.Project to add new project report

public void addProjectReport(String reportName, 
                             String description, 
                             String href) {
    projectReports().add(new ProjectReport(reportName, description, href));
}

4) modified maven-reports.xml in xdoc plugin as follows: added following
code in replace of main table body

#if (!$project.projectReports.isEmpty())
#set ($projectReportFiles = $project.projectReports)
#foreach ($reportFile in $projectReportFiles )
          <tr><td><a
href="${reportFile.href}.html">${reportFile.reportName}</a></td>
            <td>
              ${reportFile.description}
            </td>
          </tr>
#end
#end

5) modified xdoc site.dvsl as follows: added this code in place of code that
generates menu - it needs a bit of work.

<div>
#if (!$mavenProject.projectReports.isEmpty())
  <small><a href="$relativePath/maven-reports.html">Project
Reports</a></small>
  #set ($projectReportFiles = $mavenProject.projectReports)
  #if ($currentDir == "." && $infilename == "maven-reports.xml")
    #foreach ($reportFile in $projectReportFiles )
     <div><small><a
href="$relativePath/${reportFile.href}.html">${reportFile.reportName}</a></s
mall></div>
    #end
  #end
  #foreach ($reportFile in $projectReportFiles )
    #if ($currentDir == "." && $infilename == "${reportFile.href}.xml")
      #foreach ($reportFile in $projectReportFiles )
        <div><small><a
href="$relativePath/${reportFile.href}.html">${reportFile.reportName}</a></s
mall></div>
      #end
    #end
  #end
#end
</div>


6) Then for each plugin that will generate a project report, add the
following once the report has been generated

    <echo>Adding JDepend Report to Maven Reports</echo>
    ${pom.addProjectReport("Metric Results","Metric Results
description","jdepend-report")}


Note: this only allows adding reports into the site to be dynamic - how to
add the target to the site plugin dynamically is another problem.

If this would prove useful I can prepare a patch - but will have to wait
until tomorrow.

Regards,

Jon



-----Original Message-----
From: Tom Copeland [mailto:[EMAIL PROTECTED]] 
Sent: 29 August 2002 15:08
To: 'Turbine Maven Users List'
Subject: RE: Full PMD Integration?


Cool, glad you like it.

>> - Will it be distributed with maven?

Right now we're distributing it on http://pmd.sf.net/.  I vaguely remember
someone (Vincent?) suggestion a Maven plugin central thing a la JEdit.

>> - How do we make its report page show up under Project Reports?

Dunno.  Seigfried?

Yours,

Tom

-----Original Message-----
From: James CE Johnson [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 28, 2002 12:59 PM
To: [EMAIL PROTECTED]
Subject: Full PMD Integration?


Hey,

I like the PMD plugin and, thus, have a couple of questions:
- Will it be distributed with maven?
- How do we make its report page show up under Project Reports?

Thanks,
James




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




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


-------------------------------------------------------------------------------------------

This message is confidential and may also be privileged.
If you are not the intended recipient please notify us
immediately by calling ++44 (0)1865 748747. You should
not copy it or use it for any purpose nor disclose its
contents to any other person.

British Biotech Pharmaceuticals Limited
Registered Office:
Thames Court, Watlington Road,
Oxford, Oxfordshire, OX4 6LY
Registered in England and Wales No 1985479


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

Reply via email to