Updated plugin tests to verify we can generate the dashboard report by using the multiproject:site goal. Also updated documentation accordingly.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115094 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
vmassol 2004-04-30 09:05:49 +00:00
parent c48891dd9f
commit 6cde04d3b7
14 changed files with 84 additions and 52 deletions

View File

@ -186,30 +186,31 @@
--> -->
<goal name="dashboard:run-goals"> <goal name="dashboard:run-goals">
<!-- Make sure that the Clover plugin generates only the XML report (as
this is report used by the Clover aggregators to extract information
from). The reason we disable the other reports is to win some response
time. -->
<j:set var="cloverReportXml"
value="${pom.getVariable('maven.clover.report.xml')}"/>
<j:set var="maven.clover.report.xml" value="true" scope="parent"/>
<j:set var="cloverReportHtml"
value="${pom.getVariable('maven.clover.report.html')}"/>
<j:set var="maven.clover.report.html" value="false" scope="parent"/>
<j:set var="cloverReportSwing"
value="${pom.getVariable('maven.clover.report.swing')}"/>
<j:set var="maven.clover.report.swing" value="false" scope="parent"/>
<u:tokenize var="aggregatorNames" delim=",">${maven.dashboard.aggregators}</u:tokenize>
<!-- Property used to remember what goals have already been called -->
<j:set var="executedGoals" value=""/>
<!-- For each report, call the goal associated with the report type so that <!-- For each report, call the goal associated with the report type so that
raw data for that report type are generated. For example the checkstyle raw data for that report type are generated. For example the checkstyle
report type will call checkstyle:checkstyle --> report type will call checkstyle:checkstyle -->
<j:set var="rungoals" value="${maven.dashboard.rungoals}"/> <j:set var="rungoals" value="${maven.dashboard.rungoals}"/>
<j:if test="${rungoals == 'true'}"> <j:if test="${rungoals == 'true'}">
<!-- Make sure that the Clover plugin generates only the XML report (as
this is report used by the Clover aggregators to extract information
from). The reason we disable the other reports is to win some response
time. -->
<j:set var="cloverReportXml"
value="${pom.getVariable('maven.clover.report.xml')}"/>
<j:set var="maven.clover.report.xml" value="true" scope="parent"/>
<j:set var="cloverReportHtml"
value="${pom.getVariable('maven.clover.report.html')}"/>
<j:set var="maven.clover.report.html" value="false" scope="parent"/>
<j:set var="cloverReportSwing"
value="${pom.getVariable('maven.clover.report.swing')}"/>
<j:set var="maven.clover.report.swing" value="false" scope="parent"/>
<u:tokenize var="aggregatorNames" delim=",">${maven.dashboard.aggregators}</u:tokenize>
<!-- Property used to remember what goals have already been called -->
<j:set var="executedGoals" value=""/>
<j:forEach var="aggregatorName" items="${aggregatorNames}"> <j:forEach var="aggregatorName" items="${aggregatorNames}">
<a:echo>Generating data for aggregator [${aggregatorName}]</a:echo> <a:echo>Generating data for aggregator [${aggregatorName}]</a:echo>
@ -242,15 +243,16 @@
</j:if> </j:if>
</j:forEach> </j:forEach>
</j:if>
<!-- Restore Clover plugin properties --> <!-- Restore Clover plugin properties -->
<j:set var="maven.clover.report.xml" value="${cloverReportXml}" <j:set var="maven.clover.report.xml" value="${cloverReportXml}"
scope="parent"/> scope="parent"/>
<j:set var="maven.clover.report.html" value="${cloverReportHtml}" <j:set var="maven.clover.report.html" value="${cloverReportHtml}"
scope="parent"/> scope="parent"/>
<j:set var="maven.clover.report.swing" value="${cloverReportSwing}" <j:set var="maven.clover.report.swing" value="${cloverReportSwing}"
scope="parent"/> scope="parent"/>
</j:if>
</goal> </goal>

View File

@ -34,7 +34,8 @@
<attainGoal name="multiproject:goal"/> <attainGoal name="multiproject:goal"/>
<!-- Call goal to test --> <!-- Call goal to test -->
<attainGoal name="site"/> <j:set var="maven.multiproject.site.goals" value="site,dashboard:report-single"/>
<attainGoal name="multiproject:site"/>
</goal> </goal>

View File

@ -28,3 +28,8 @@ offline=true
maven.multiproject.basedir=${basedir} maven.multiproject.basedir=${basedir}
maven.multiproject.includes=*/project.xml maven.multiproject.includes=*/project.xml
maven.multiproject.excludes= maven.multiproject.excludes=
# Turn off these properties are we're using the multiproject plugin to
# generate the dashboard
maven.dashboard.rungoals = false
maven.dashboard.runreactor = false

View File

@ -22,3 +22,5 @@ maven.xdoc.date=left
maven.checkstyle.header.file = ${basedir}/../LICENSE.txt maven.checkstyle.header.file = ${basedir}/../LICENSE.txt
maven.dashboard.aggregators = csall,cserrors,cswarnings,clovertpc,cloverloc,cloverncloc,junittests,junitpassrate,junitfailures,juniterrors maven.dashboard.aggregators = csall,cserrors,cswarnings,clovertpc,cloverloc,cloverncloc,junittests,junitpassrate,junitfailures,juniterrors
maven.clover.report.xml = true

View File

@ -36,5 +36,6 @@
<reports> <reports>
<report>maven-checkstyle-plugin</report> <report>maven-checkstyle-plugin</report>
<report>maven-clover-plugin</report> <report>maven-clover-plugin</report>
<report>maven-junit-report-plugin</report>
</reports> </reports>
</project> </project>

View File

@ -22,3 +22,4 @@ maven.xdoc.date=left
maven.checkstyle.header.file = ${basedir}/../LICENSE.txt maven.checkstyle.header.file = ${basedir}/../LICENSE.txt
maven.dashboard.aggregators = csall,cserrors,cswarnings,clovertpc,cloverloc,cloverncloc,junittests,junitpassrate,junitfailures,juniterrors maven.dashboard.aggregators = csall,cserrors,cswarnings,clovertpc,cloverloc,cloverncloc,junittests,junitpassrate,junitfailures,juniterrors
maven.dashboard.rungoals = true

View File

@ -22,6 +22,8 @@
<id>test-maven-dashboard-plugin-subproject2</id> <id>test-maven-dashboard-plugin-subproject2</id>
<name>Maven Dashboard plugin test - Subproject2</name> <name>Maven Dashboard plugin test - Subproject2</name>
<reports> <reports>
<report>maven-checkstyle-plugin</report> <!-- Voluntarily do not put any report. We're forcing the execution
of artifact goals using the maven.dashboard.rungoals=true
property -->
</reports> </reports>
</project> </project>

View File

@ -1,4 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- <!--
/* /*
* Copyright 2001-2004 The Apache Software Foundation. * Copyright 2001-2004 The Apache Software Foundation.

View File

@ -1,4 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- <!--
/* /*
* Copyright 2001-2004 The Apache Software Foundation. * Copyright 2001-2004 The Apache Software Foundation.

View File

@ -27,6 +27,11 @@
<body> <body>
<release version="1.3" date="in CVS"> <release version="1.3" date="in CVS">
<action dev="vmassol" type="update">
Updated plugin tests to verify we can generate the dashboard
report by using the multiproject:site goal. Also updated documentation
accordingly.
</action>
<action dev="vmassol" type="update"> <action dev="vmassol" type="update">
Removed explicit dependencies on <code>maven-clover-plugin</code> and Removed explicit dependencies on <code>maven-clover-plugin</code> and
<code>maven-junit-report-plugin</code>. The reason I've removed the <code>maven-junit-report-plugin</code>. The reason I've removed the

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
/* /*
* Copyright 2001-2004 The Apache Software Foundation. * Copyright 2001-2004 The Apache Software Foundation.
@ -17,7 +18,6 @@
*/ */
--> -->
<document> <document>
<properties> <properties>
<title>Maven Dashboard plugin goals</title> <title>Maven Dashboard plugin goals</title>

View File

@ -84,32 +84,42 @@
<code>maven xdoc</code> to transform it into an HTML file. <code>maven xdoc</code> to transform it into an HTML file.
</p> </p>
</subsection> </subsection>
<subsection name="Solution 3: Including it in a custom reactor"> <subsection name="Solution 3: Using the multiproject plugin">
<p><strong>
Only use this solution if you're already familiar with the
dashboard plugin.
</strong></p>
<p> <p>
If you are already running a custom reactor you have the possibility In your master project, add a <code>maven-dashboard-report</code>
to integrate the dashboard plugin in your reactor build. You would report entry:
do this to shorten the build time.
</p> </p>
<source><![CDATA[
<reports>
[...]
<report>maven-dashboard-plugin</report>
</reports>
]]></source>
<p> <p>
To do this, you need to add the <code>dashboard:report-single</code>
goal to the list of goals being run by your reactor. The best option
is to ensure this goal is run after the other goals generating the
report artifacts needed by the dashboard aggregators you're running.
In order to prevent the <code>dashboard:report-single</code> goal from
automatically calling the report artifact goals, you'll need to add
the following property: <code>maven.dashboard.rungoals = false</code>.
</p>
<p> <p>
At the master project level, you'll simply need to add a report entry Add the following 3 properties to your master project:
as described above in 'Solution 1'. You'll also need to add the
following property: <code>maven.dashboard.runreactor = false</code>.
This property prevents the dashboard plugin from automatically calling
the dashboard reactor.
</p> </p>
<source><![CDATA[
# Tells the dashboard plugin not to run its own reactor.
# We'll use the one run by the multiproject.
maven.dashboard.runreactor = false
# (optional). Tells the dashboard not to specifically run
# artifact goals (i.e. goals that generate artifacts that we aggregate
# in the dashboard report). For example, if you already have defined
# the reports generating these artifacts, you'd be better setting
# rungoals to false so that the artifact goals are only run once.
maven.dashboard.rungoals = false
# Tells the multiproject plugin to execute the dashboard:report-single
# goal on each project when you run it through multiproject:site.
maven.multiproject.site.goals=site,dashboard:report-single
]]></source>
<p>
Then generate the site by running the <code>multiproject:site</code>
goal.
</p>
</subsection> </subsection>
</section> </section>
</body> </body>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<!-- <!--
/* /*
* Copyright 2001-2004 The Apache Software Foundation. * Copyright 2001-2004 The Apache Software Foundation.

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
/* /*
* Copyright 2001-2004 The Apache Software Foundation. * Copyright 2001-2004 The Apache Software Foundation.
@ -17,7 +18,6 @@
*/ */
--> -->
<document> <document>
<properties> <properties>
<title>Maven Dashboard plugin properties</title> <title>Maven Dashboard plugin properties</title>