- Renamed probes/reports into aggregators
- Added several other aggregators - Do not run report artifact goal if it has already been run by a previous aggregator git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114266 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
226a5936b5
commit
df5131d5d1
19 files changed
+467
-45
No files matched your search
+24
-11
@@ -83,7 +83,7 @@
|
||||
<u:file var="dashboardAsFile"
|
||||
name="${reactorProject.context.getVariable('maven.build.dir')}/dashboard-single.xml"/>
|
||||
<x:parse var="doc" xml="${dashboardAsFile}"/>
|
||||
<x:copyOf select="$doc//report"/>
|
||||
<x:copyOf select="$doc//aggregator"/>
|
||||
|
||||
</x:element>
|
||||
</j:forEach>
|
||||
@@ -122,32 +122,45 @@
|
||||
<a:dirname property="singleReportDir" file="${maven.dashboard.report.single}"/>
|
||||
<a:mkdir dir="${singleReportDir}"/>
|
||||
|
||||
<u:tokenize var="reportNames" delim=",">${maven.dashboard.reports}</u:tokenize>
|
||||
<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
|
||||
raw data for that report type are generated. For example the checkstyle
|
||||
report type will call checkstyle:checkstyle -->
|
||||
<j:set var="rungoals" value="${maven.dashboard.rungoals}"/>
|
||||
<j:if test="${rungoals == 'true'}">
|
||||
<j:forEach var="reportName" items="${reportNames}">
|
||||
<j:forEach var="aggregatorName" items="${aggregatorNames}">
|
||||
|
||||
<j:set var="goalProperty"
|
||||
value="maven.dashboard.report.${reportName}.goal"/>
|
||||
<attainGoal name="${context.getVariable(goalProperty)}"/>
|
||||
value="maven.dashboard.aggregator.${aggregatorName}.goal"/>
|
||||
|
||||
<!-- Only run if the artifact has not already been created by
|
||||
a previous goal run -->
|
||||
<j:if test="${executedGoals.indexOf(context.getVariable(goalProperty)) == '-1'}">
|
||||
<attainGoal name="${context.getVariable(goalProperty)}"/>
|
||||
</j:if>
|
||||
|
||||
<j:set var="executedGoals"
|
||||
value="${goalProperty},${executedGoals}"/>
|
||||
|
||||
</j:forEach>
|
||||
</j:if>
|
||||
|
||||
<j:file name="${maven.dashboard.report.single}" prettyPrint="true"
|
||||
xmlns="dashboard">
|
||||
<dashboard-single>
|
||||
<j:forEach var="reportName" items="${reportNames}">
|
||||
<x:element name="report">
|
||||
<j:forEach var="aggregatorName" items="${aggregatorNames}">
|
||||
<x:element name="aggregator">
|
||||
|
||||
<!-- Add report name -->
|
||||
<x:attribute name="name">${reportName}</x:attribute>
|
||||
<!-- Add aggregator name -->
|
||||
<x:attribute name="name">${aggregatorName}</x:attribute>
|
||||
|
||||
<!-- Add report content -->
|
||||
<!-- Add aggregator content -->
|
||||
<j:set var="scriptProperty"
|
||||
value="maven.dashboard.report.${reportName}.script"/>
|
||||
value="maven.dashboard.aggregator.${aggregatorName}.script"/>
|
||||
<j:import file="${context.getVariable(scriptProperty)}"
|
||||
inherit="true"/>
|
||||
|
||||
|
||||
@@ -35,17 +35,47 @@ maven.dashboard.runreactor = true
|
||||
# Properties for gathering dashboard data for a single project
|
||||
# ------------------------------------------------------------
|
||||
|
||||
# Location of default dashboard adaptors
|
||||
maven.dashboard.reports.dir = ${plugin.resources}/reports
|
||||
# Location of default dashboard aggregators
|
||||
maven.dashboard.aggregators.dir = ${plugin.resources}/reports
|
||||
|
||||
# List of reports to aggregate
|
||||
maven.dashboard.reports = checkstyle
|
||||
# Comma-separated list of aggregators to use
|
||||
maven.dashboard.aggregators = cserrors,cswarnings,clovertpc,cloverloc,cloverncloc
|
||||
|
||||
# Properties for the default checkstyle adaptor
|
||||
maven.dashboard.report.checkstyle.script = ${maven.dashboard.reports.dir}/checkstyle.jelly
|
||||
maven.dashboard.report.checkstyle.artifact = ${maven.build.dir}/checkstyle-raw-report.xml
|
||||
maven.dashboard.report.checkstyle.label = Checkstyle errors
|
||||
maven.dashboard.report.checkstyle.goal = checkstyle
|
||||
# Properties for the Checkstyle error/warning aggregator (all errors/warnings)
|
||||
maven.dashboard.aggregator.csall.script = ${maven.dashboard.aggregators.dir}/csall.jelly
|
||||
maven.dashboard.aggregator.csall.artifact = ${maven.build.dir}/checkstyle-raw-report.xml
|
||||
maven.dashboard.aggregator.csall.label = CS err/warn
|
||||
maven.dashboard.aggregator.csall.goal = checkstyle
|
||||
|
||||
# Properties for the Checkstyle error aggregator (only errors)
|
||||
maven.dashboard.aggregator.cserrors.script = ${maven.dashboard.aggregators.dir}/cserrors.jelly
|
||||
maven.dashboard.aggregator.cserrors.artifact = ${maven.build.dir}/checkstyle-raw-report.xml
|
||||
maven.dashboard.aggregator.cserrors.label = CS errors
|
||||
maven.dashboard.aggregator.cserrors.goal = checkstyle
|
||||
|
||||
# Properties for the Checkstyle warning aggregator (only warnings)
|
||||
maven.dashboard.aggregator.cswarnings.script = ${maven.dashboard.aggregators.dir}/cswarnings.jelly
|
||||
maven.dashboard.aggregator.cswarnings.artifact = ${maven.build.dir}/checkstyle-raw-report.xml
|
||||
maven.dashboard.aggregator.cswarnings.label = CS warnings
|
||||
maven.dashboard.aggregator.cswarnings.goal = checkstyle
|
||||
|
||||
# Properties for the Clover TPC aggregator (TPC = Total Percent Coverage)
|
||||
maven.dashboard.aggregator.clovertpc.script = ${maven.dashboard.aggregators.dir}/clovertpc.jelly
|
||||
maven.dashboard.aggregator.clovertpc.artifact = ${maven.build.dir}/clover.xml
|
||||
maven.dashboard.aggregator.clovertpc.label = Clover TPC
|
||||
maven.dashboard.aggregator.clovertpc.goal = clover
|
||||
|
||||
# Properties for the Clover LOC aggregator (LOC = Line Of Code)
|
||||
maven.dashboard.aggregator.cloverloc.script = ${maven.dashboard.aggregators.dir}/cloverloc.jelly
|
||||
maven.dashboard.aggregator.cloverloc.artifact = ${maven.build.dir}/clover.xml
|
||||
maven.dashboard.aggregator.cloverloc.label = Clover LOC
|
||||
maven.dashboard.aggregator.cloverloc.goal = clover
|
||||
|
||||
# Properties for the Clover NCLOC aggregator (NCLOC = Non Comment Line Of Code)
|
||||
maven.dashboard.aggregator.cloverncloc.script = ${maven.dashboard.aggregators.dir}/cloverncloc.jelly
|
||||
maven.dashboard.aggregator.cloverncloc.artifact = ${maven.build.dir}/clover.xml
|
||||
maven.dashboard.aggregator.cloverncloc.label = Clover NCLOC
|
||||
maven.dashboard.aggregator.cloverncloc.goal = clover
|
||||
|
||||
# Generated dashboard data for a single project
|
||||
maven.dashboard.report.single = ${maven.build.dir}/dashboard-single.xml
|
||||
|
||||
@@ -4,3 +4,8 @@
|
||||
maven.xdoc.date=left
|
||||
maven.xdoc.version=${pom.currentVersion}
|
||||
maven.checkstyle.header.file = ${basedir}/../../LICENSE.txt
|
||||
|
||||
# Required to generate XML clover report
|
||||
maven.clover.report.xml = true
|
||||
|
||||
maven.dashboard.aggregators = csall,cserrors,cswarnings,clovertpc,cloverloc,cloverncloc
|
||||
@@ -1,2 +1,3 @@
|
||||
target
|
||||
maven.log
|
||||
velocity.log
|
||||
@@ -56,10 +56,17 @@
|
||||
<!-- build information for the project -->
|
||||
<build>
|
||||
<sourceDirectory>src/java</sourceDirectory>
|
||||
<unitTestSourceDirectory>src/test</unitTestSourceDirectory>
|
||||
<unitTest>
|
||||
<includes>
|
||||
<include>**/Test*.java</include>
|
||||
</includes>
|
||||
</unitTest>
|
||||
</build>
|
||||
|
||||
<reports>
|
||||
<report>maven-checkstyle-plugin</report>
|
||||
<report>maven-clover-plugin</report>
|
||||
</reports>
|
||||
|
||||
</project>
|
||||
+5
-1
@@ -61,10 +61,14 @@ package org.apache.maven.dashboard.sample.subproject1;
|
||||
*
|
||||
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
|
||||
*
|
||||
* @version $Id: Sample.java,v 1.1 2003/11/04 21:11:31 vmassol Exp $
|
||||
* @version $Id: Sample.java,v 1.2 2003/11/05 19:26:58 vmassol Exp $
|
||||
*/
|
||||
public class Sample
|
||||
{
|
||||
public void unusedMethod()
|
||||
{
|
||||
}
|
||||
|
||||
public void someMethod()
|
||||
{
|
||||
new Boolean(true);
|
||||
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package org.apache.maven.dashboard.sample.subproject1;
|
||||
|
||||
/* ====================================================================
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 2001 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. The end-user documentation included with the redistribution,
|
||||
* if any, must include the following acknowledgment:
|
||||
* "This product includes software developed by the
|
||||
* Apache Software Foundation (http://www.apache.org/)."
|
||||
* Alternately, this acknowledgment may appear in the software itself,
|
||||
* if and wherever such third-party acknowledgments normally appear.
|
||||
*
|
||||
* 4. The names "Apache" and "Apache Software Foundation" and
|
||||
* "Apache Maven" must not be used to endorse or promote products
|
||||
* derived from this software without prior written permission. For
|
||||
* written permission, please contact apache@apache.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "Apache",
|
||||
* "Apache Maven", nor may "Apache" appear in their name, without
|
||||
* prior written permission of the Apache Software Foundation.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This software consists of voluntary contributions made by many
|
||||
* individuals on behalf of the Apache Software Foundation. For more
|
||||
* information on the Apache Software Foundation, please see
|
||||
* <http://www.apache.org/>.
|
||||
*
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* Sample test for {@link Sample} to test the Clover aggregator.
|
||||
*
|
||||
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
|
||||
*
|
||||
* @version $Id: TestSample.java,v 1.1 2003/11/05 19:26:58 vmassol Exp $
|
||||
*/
|
||||
public class TestSample extends TestCase
|
||||
{
|
||||
public void testSomeMethod()
|
||||
{
|
||||
Sample sample = new Sample();
|
||||
sample.someMethod();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package org.apache.maven.dashboard.aggregator.clover;
|
||||
|
||||
/* ====================================================================
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 2001 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. The end-user documentation included with the redistribution,
|
||||
* if any, must include the following acknowledgment:
|
||||
* "This product includes software developed by the
|
||||
* Apache Software Foundation (http://www.apache.org/)."
|
||||
* Alternately, this acknowledgment may appear in the software itself,
|
||||
* if and wherever such third-party acknowledgments normally appear.
|
||||
*
|
||||
* 4. The names "Apache" and "Apache Software Foundation" and
|
||||
* "Apache Maven" must not be used to endorse or promote products
|
||||
* derived from this software without prior written permission. For
|
||||
* written permission, please contact apache@apache.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "Apache",
|
||||
* "Apache Maven", nor may "Apache" appear in their name, without
|
||||
* prior written permission of the Apache Software Foundation.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This software consists of voluntary contributions made by many
|
||||
* individuals on behalf of the Apache Software Foundation. For more
|
||||
* information on the Apache Software Foundation, please see
|
||||
* <http://www.apache.org/>.
|
||||
*
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
|
||||
*
|
||||
* @version $Id: CloverTPC.java,v 1.1 2003/11/05 19:26:59 vmassol Exp $
|
||||
*/
|
||||
public class CloverTPC
|
||||
{
|
||||
public static String computeTPC(String elements, String coveredElements)
|
||||
{
|
||||
double e = Double.valueOf(elements).doubleValue();
|
||||
double ce = Double.valueOf(coveredElements).doubleValue();
|
||||
DecimalFormat formatter = new DecimalFormat("##%");
|
||||
return formatter.format(ce/e);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
========================================================================
|
||||
Clover aggregator. Extracts total line of code (LOC) from Clover
|
||||
raw file.
|
||||
========================================================================
|
||||
-->
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util">
|
||||
|
||||
<!-- Extract LOC -->
|
||||
|
||||
<u:file var="artifactAsFile"
|
||||
name="${maven.dashboard.aggregator.cloverloc.artifact}"/>
|
||||
<j:choose>
|
||||
<j:when test="${artifactAsFile.exists()}">
|
||||
|
||||
<x:parse var="doc" xml="${artifactAsFile}"/>
|
||||
<x:expr select="string($doc/coverage/project/metrics/@loc)"/>
|
||||
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<j:expr value="-"/>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
|
||||
</j:jelly>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
========================================================================
|
||||
Clover aggregator. Extracts total non-commented lines of code (NCLOC)
|
||||
from Clover raw file.
|
||||
========================================================================
|
||||
-->
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util">
|
||||
|
||||
<!-- Extract NCLOC -->
|
||||
|
||||
<u:file var="artifactAsFile"
|
||||
name="${maven.dashboard.aggregator.cloverncloc.artifact}"/>
|
||||
<j:choose>
|
||||
<j:when test="${artifactAsFile.exists()}">
|
||||
|
||||
<x:parse var="doc" xml="${artifactAsFile}"/>
|
||||
<x:expr select="string($doc/coverage/project/metrics/@ncloc)"/>
|
||||
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<j:expr value="-"/>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
|
||||
</j:jelly>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
========================================================================
|
||||
Clover aggregator. Extracts total coverage percentage from Clover
|
||||
raw file.
|
||||
========================================================================
|
||||
-->
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util">
|
||||
|
||||
<!-- Extract total coverage percentage -->
|
||||
|
||||
<u:file var="artifactAsFile"
|
||||
name="${maven.dashboard.aggregator.clovertpc.artifact}"/>
|
||||
<j:choose>
|
||||
<j:when test="${artifactAsFile.exists()}">
|
||||
|
||||
<x:parse var="doc" xml="${artifactAsFile}"/>
|
||||
|
||||
<x:set var="coveredelements"
|
||||
select="string($doc/coverage/project/metrics/@coveredelements)"/>
|
||||
<x:set var="elements"
|
||||
select="string($doc/coverage/project/metrics/@elements)"/>
|
||||
|
||||
<j:useBean var="tpc"
|
||||
class="org.apache.maven.dashboard.aggregator.clover.CloverTPC"/>
|
||||
<j:expr value="${tpc.computeTPC(elements, coveredelements)}"/>
|
||||
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<j:expr value="-"/>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
|
||||
</j:jelly>
|
||||
+9
-4
@@ -1,17 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
========================================================================
|
||||
Checkstyle aggregator. Extracts error count from Checkstyle raw XML
|
||||
file.
|
||||
========================================================================
|
||||
-->
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util">
|
||||
|
||||
<!-- Extract error count from Checkstyle raw XML file -->
|
||||
|
||||
<u:file var="artifactAsFile"
|
||||
name="${maven.dashboard.report.checkstyle.artifact}"/>
|
||||
name="${maven.dashboard.aggregator.csall.artifact}"/>
|
||||
<j:choose>
|
||||
<j:when test="${artifactAsFile.exists()}">
|
||||
<x:parse var="doc" xml="${artifactAsFile}"/>
|
||||
<x:expr select="count($doc//error)"/>
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<j:expr value="n/a"/>
|
||||
<j:expr value="-"/>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
========================================================================
|
||||
Checkstyle error aggregator. Extracts error count from Checkstyle raw
|
||||
XML file (does not count warnings).
|
||||
========================================================================
|
||||
-->
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util">
|
||||
|
||||
<u:file var="artifactAsFile"
|
||||
name="${maven.dashboard.aggregator.cserrors.artifact}"/>
|
||||
<j:choose>
|
||||
<j:when test="${artifactAsFile.exists()}">
|
||||
<x:parse var="doc" xml="${artifactAsFile}"/>
|
||||
<x:expr select="count($doc//error[@severity = 'error'])"/>
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<j:expr value="-"/>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
|
||||
</j:jelly>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
========================================================================
|
||||
Checkstyle error aggregator. Extracts warning count from Checkstyle
|
||||
raw XML file (does not count errors).
|
||||
========================================================================
|
||||
-->
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util">
|
||||
|
||||
<u:file var="artifactAsFile"
|
||||
name="${maven.dashboard.aggregator.cserrors.artifact}"/>
|
||||
<j:choose>
|
||||
<j:when test="${artifactAsFile.exists()}">
|
||||
<x:parse var="doc" xml="${artifactAsFile}"/>
|
||||
<x:expr select="count($doc//error[@severity = 'warning'])"/>
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<j:expr value="-"/>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
|
||||
</j:jelly>
|
||||
@@ -17,10 +17,10 @@
|
||||
<table>
|
||||
<tr>
|
||||
<th>Project</th>
|
||||
<x:forEach var="reportName" select="project[1]/report/@name">
|
||||
<x:forEach var="aggregatorName" select="project[1]/aggregator/@name">
|
||||
<th>
|
||||
<j:set var="labelProperty"
|
||||
value="maven.dashboard.report.${reportName.value}.label"/>
|
||||
value="maven.dashboard.aggregator.${aggregatorName.value}.label"/>
|
||||
<j:expr value="${context.getVariable(labelProperty)}"/>
|
||||
</th>
|
||||
</x:forEach>
|
||||
@@ -35,11 +35,11 @@
|
||||
<jsl:template match="project">
|
||||
<tr>
|
||||
<td><x:expr select="@name"/></td>
|
||||
<jsl:applyTemplates select="report"/>
|
||||
<jsl:applyTemplates select="aggregator"/>
|
||||
</tr>
|
||||
</jsl:template>
|
||||
|
||||
<jsl:template match="report">
|
||||
<jsl:template match="aggregator">
|
||||
<td>
|
||||
<x:expr select="text()"/>
|
||||
</td>
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Maven Dashboard aggregators</title>
|
||||
<author email="vmassol@apache.org">Vincent Massol</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Maven Dashboard aggregators">
|
||||
<p>
|
||||
An aggregator is an extension to the dashboard that gathers
|
||||
metric information that get displayed in the dashboard report.
|
||||
You can provide your own custom aggregators. The dashboard plugin
|
||||
comes with several default aggregators described below.
|
||||
</p>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Aggregator name</th>
|
||||
<th>Topic</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>csall</td>
|
||||
<td>Checkstyle</td>
|
||||
<td>
|
||||
Computes total number of Checkstyle warnings and errors.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cserrors</td>
|
||||
<td>Checkstyle</td>
|
||||
<td>
|
||||
Computes total number of Checkstyle errors.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cswarnings</td>
|
||||
<td>Checkstyle</td>
|
||||
<td>
|
||||
Computes total number of Checkstyle warnings.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clovertpc</td>
|
||||
<td>Clover</td>
|
||||
<td>
|
||||
Computes total Test Coverage Percentage (TPC) using Clover.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cloverloc</td>
|
||||
<td>Clover</td>
|
||||
<td>
|
||||
Computes total Line Of Code (LOC) using Clover.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cloverncloc</td>
|
||||
<td>Clover</td>
|
||||
<td>
|
||||
Computes total Non-Commented Line Of Code (NCLOC) using Clover.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
@@ -19,14 +19,17 @@
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
Pluggable architecture. It allows to add custom probes for any
|
||||
Pluggable architecture. It allows to add custom aggregators for any
|
||||
kind of report, be them Maven reports or anything else (like
|
||||
calling an SCM system, calling JIRA, etc). A probe is actually a
|
||||
Jelly script so that you have the full power of Jelly at your hand.
|
||||
calling an SCM system, calling JIRA, etc). An aggregator is actually
|
||||
a Jelly script so that you have the full power of Jelly at your hand.
|
||||
</li>
|
||||
<li>
|
||||
Provides a default probe for gathering the number of Checkstyle
|
||||
errors in subprojects.
|
||||
Provides <a href="aggregators.html">default aggregators</a>.
|
||||
</li>
|
||||
<li>
|
||||
Allows tight integration in one's own custom reactor and prevents
|
||||
running reports several times.
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
@@ -72,8 +75,8 @@
|
||||
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 probes you're running. In
|
||||
order to prevent the <code>dashboard:report-single</code> goal from
|
||||
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>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<menu name="Overview">
|
||||
<item name="Goals" href="/goals.html"/>
|
||||
<item name="Properties" href="/properties.html"/>
|
||||
<item name="Aggregators" href="/aggregators.html"/>
|
||||
</menu>
|
||||
</body>
|
||||
</project>
|
||||
@@ -38,17 +38,17 @@ maven.dashboard.runreactor = true
|
||||
# Properties for gathering dashboard data for a single project
|
||||
# ------------------------------------------------------------
|
||||
|
||||
# Location of default dashboard adaptors
|
||||
maven.dashboard.reports.dir = ${plugin.resources}/reports
|
||||
# Location of default dashboard aggregators
|
||||
maven.dashboard.aggregators.dir = ${plugin.resources}/reports
|
||||
|
||||
# List of reports to aggregate
|
||||
maven.dashboard.reports = checkstyle
|
||||
# Comma-separated list of aggregators to use
|
||||
maven.dashboard.aggregators = checkstyle
|
||||
|
||||
# Properties for the default checkstyle adaptor
|
||||
maven.dashboard.report.checkstyle.script = ${maven.dashboard.reports.dir}/checkstyle.jelly
|
||||
maven.dashboard.report.checkstyle.artifact = ${maven.build.dir}/checkstyle-raw-report.xml
|
||||
maven.dashboard.report.checkstyle.label = Checkstyle errors
|
||||
maven.dashboard.report.checkstyle.goal = checkstyle
|
||||
# Properties for the default checkstyle aggregator
|
||||
maven.dashboard.aggregator.checkstyle.script = ${maven.dashboard.aggregators.dir}/checkstyle.jelly
|
||||
maven.dashboard.aggregator.checkstyle.artifact = ${maven.build.dir}/checkstyle-raw-report.xml
|
||||
maven.dashboard.aggregator.checkstyle.label = Checkstyle errors
|
||||
maven.dashboard.aggregator.checkstyle.goal = checkstyle
|
||||
|
||||
# Generated dashboard data for a single project
|
||||
maven.dashboard.report.single = ${maven.build.dir}/dashboard-single.xml
|
||||
|
||||
Reference in new issue
Block a user