Warning

This page is a documentation for maven 1 plugin. As the java world seems to moving to maven 2 and as the XRadar community does not have enough resources for it, this maven plugin will not be maintain ( unless somebody volunteer to do it).

The Maven Plugin

Installation

Download the latest maven-xradar-plugin from the xradar sourceforge page, and place it in $MAVEN_HOME/plugins/

Simple first run on your project

To run it now on your project or your cluster of projects (the projects must have been build in advance by f.ex. maven multiproject:install), simply go to the ROOT of the cluster and run :

maven xradar -Dxradar.output.dir=$ROOT/target/xradar
                

e.g.

maven xradar -Dxradar.output.dir=c:/sourceforge/xradar/xradar-maven/target/xradar
                

ROOT refers to the root project. The reason why you need to specify xradar.output.dir on the command line is that you want to have this property be global when running the multiproject.

The process might take a while, depending on the size of your project. If the total project is really large, expect to wait 20 minutes. The xradar will aggregate your junit and cobertura test coverage results, if you have such in the project. Notice that you need to have been using maven-cobertura-plugin 1.1.1 or higher in order for the coverage to work. The resulting report is found under $ROOT/target/xradar/docs/index.html.

You now have the complete metric picture of your whole project, but have not yet seen the whole magic of the XRadar.

Second run on your project with system configuration

The second run should be used to add additional configuration to the project. This configuration should be set in project.properties in your ROOT-project.

The most important part of your configuration is to set up the xradar.config property. This property should point to an XML file that is similar to the radar-config.xml for the xradar testproject. See here for all the details of configuring this file.

The second thing you might want to do is to set the property coupling.analysis=true . Setting this property will cause the xradar to analyse the detailed coupling characteristics of your project (method to method). Running with this property on a very large and highly coupled project is very time consuming. The whole process might take about 24 hours. For small to medium-sized projects, running with this property on will make your analysis a lot more advanced on the detailed level. It will probably just add a few seconds to the total processing time.

Third, you can configure the XRadar plugin to generate javadoc for the whole extracted source for all the multiple projects. In the XRadar report you can then navigate directly from a class to the javadoc of that class. Do that by setting the property : xradar.generate.javadoc=true . Optionally, if you already have the javadoc generated for the whole source (f.ex on a webserver), you can integrate this into the xradar by setting the two properties : javadoc.report=true and javadoc.root=JAVADOC_API_ROOT .

To summarize, the following properties are recommended to be set in your project.properties file in the ROOT project:

xradar.config=$SOME_PATH/radar-config.xml
coupling.analysis=true
xradar.generate.javadoc=true
	                

Finally, you might want to override the default properties that are set in the plugin :

pmd.analysis.rulesetfiles=rulesets/basic.xml,rulesets/imports.xml,rulesets/unusedcode.xml,rulesets/design.xml,rulesets/codesize.xml,rulesets/braces.xml, rulesets/coupling.xml, rulesets/optimizations.xml, rulesets/sunsecure.xml, rulesets/logging-java.xml, rulesets/strings.xml
cpd.analysis.minimum.token.count=75
checkstyle.analysis.checks=${xradar.home}/etc/config/sun_checks.xml
	                
See here for more on the meaning of these and other xradar properties (remember that many of these are specific to the xradar-ant configuration).

What's left for the maven-plugin

One of the best parts of the XRadar is that you can see the dynamic nature of the project (i.e. how it trends). That has not yet been incorporated into the maven plugin. So if you want to see these trends, you have to do that configuration manually though ant. See the dynamics configuration page for more on that. Please note that the xradar-team are welcoming suggestions for how the maven dynamics-config should be designed.