XRadar Maven2 plugin documentation (version 1.2.2)

New features (since 1.2) :

  • XRadar-1.1 dependency updated.
  • Cobertura, emma and findbugs reports added.
  • New parameter (alpha) : aggregate : When running on a multi-modules project, aggregate the report in the parent project.

warnings for 1.2.2 :

  • Junit report is not yet supported :(
  • aggregate parameter is only in alpha verison so it's not totally supported.

New features (since 1.1) :

  • Goals are now available :
    • net.sf.xradar:maven-xradar-plugin:audit
    • net.sf.xradar:maven-xradar-plugin:dynamic
  • There is 3 ways to use XRadar's plugin as a report plugin (since 1.1-beta):
    • automatic mode : you only have to declare maven-xradar-plugin as shown below. XRadar will download and execute all the reports tools plugins with default configuration.
    • custom mode : use your custom report plugin tools configuration. declare desired plugins and configurations then maven-xradar-plugin. XRadar will execute your plugin's configuration and default ones for the not declared plugins. Note that if you put "autoRadar" parameters to "false", XRadar will only execute your plugins.
    • aggregator mode use already created report's files : No report plugins are executed. XRadar will just aggregate your report files.

Run direct goals

Execute your report plugins or lauch "mvn site". Then call xradar's goals :

goal description
net.sf.xradar:maven-xradar-plugin:audit the static audit
net.sf.xradar:maven-xradar-plugin:dynamic the dynamic audit
You can also configure the plugin, in the build section :
				
<build>
  <plugins>
  
  ...
  	
    <plugin>
  	  <groupId>net.sf.xradar</groupId>
  	  <artifactId>maven-xradar-plugin</artifactId>
  	  <version>1.2.2</version>
  	</plugin>
  </plugins>
 
</build>
			
			

Use maven-xradar-plugin as part of maven site lifecycle

To add XRadar report to your site, you must add the maven-xradar-plugin to the special reporting section in the POM as the last report :
				
<reporting>
  <plugins>
  
  ...
  	
    <plugin>
  	  <groupId>net.sf.xradar</groupId>
  	  <artifactId>maven-xradar-plugin</artifactId>
  	  <version>1.2.2</version>
  	</plugin>
  </plugins>
</reporting>
			
			

Automatic mode (default mode)

Just add the maven-xradar-plugin declaration in your pom, then execute mvn site :

				
<reporting>
  <plugins>
    <plugin>
  	  <groupId>net.sf.xradar</groupId>
  	  <artifactId>maven-xradar-plugin</artifactId>
  	  <version>1.2.2</version>
  	</plugin>
  </plugins>
</reporting>
			
			

See the result in the report section of your project's site.

Custom mode

Add your custom configurations and at last the maven-xradar-plugin declaration in your pom, then execute mvn site or mvn clean compile site :

For example :

				
<reporting>
  <plugins>	
  
  ...
  
    <plugin>
      <artifactId>maven-pmd-plugin</artifactId>
        <configuration>
			<linkXref>true</linkXref>
			<sourceEncoding>utf-8</sourceEncoding>
			<minimumTokens>100</minimumTokens>
			<targetJdk>1.5</targetJdk>
		</configuration>
	</plugin>
	
  ...	

	<plugin>
  	  <groupId>net.sf.xradar</groupId>
  	  <artifactId>maven-xradar-plugin</artifactId>
  	  <version>1.2.2</version>
  	  <configuration>
  	    <autoRadar>true</autoRadar> <!--false to execute only the plugins declared-->
  	  </configuration>
  	</plugin>
  </plugins>
</reporting>
			
			

Aggregator mode

Add the maven-xradar-plugin declaration in your pom and configure the path to the already report files generated, then execute mvn site :

For example :

				
<reporting>
  <plugins>	
	<plugin>
  	  <groupId>net.sf.xradar</groupId>
  	  <artifactId>maven-xradar-plugin</artifactId>
  	  <version>1.2.2</version>
  	  <configuration>
  	    <autoRadar>false</autoRadar> <!--need to be set at false-->
  	    <reportPmd>${project.build.directory}/resources/pmd.xml</reportPmd>
  	    <reportCheckstyle>${project.build.directory}/resources/checkstyle.xml</reportCheckstyle>
      </configuration>
  	</plugin>
  </plugins>
</reporting>
			
			

What do you need else ?

To analyse your project, XRadar, and therefore its maven plugin, needs a couple more files:

  1. src/main/resources/xradar/radar-config.xml
  2. src/main/resources/xradar/release{version}.properties , (where {version} is the version of your project declared in its pom.xml)

Note, that if you didn't create those files XRadar will use default ones.

you can see default files as examples here : xradar-config-default.xml and here : default-release.properties

To have XRadar static and dynamic analyse of your project run " mvn site ". To be sure that your are analysing the last version of your code run " mvn clean compile site ".

WARNINGS :

  • the "projectVersion" declared in the pom of your project must match with the filename "src/main/resources/xradar/release{version}.properties" and the field "version.label={version}" declared inside the release{version}.properties file.
  • for the first use, you have to put "sequence.id=1" in the release{version}.properties file.
  • When using maven-xradar-plugin by calling mvn site, the Xradar report is added to the report section of the site. When calling xradar's goals, the Xradar report is produce on the same directory but is not added to the project's site generated.
  • the maven-site language configuration doesn't work, so don't add the following :
    							
    <locales>...</locales>
    			
    						
  • When using maven-xradar-plugin as a report plugin (using "mvn site" goal) in a multi-module project with custom configuration, xradar is not executed as the last for the child so the aggregation of reports is not complete. To avoid this issue you may call "mvn site" and then call "audit" and "dynamic" goals.

Setup Maven

Increase the memory allocated to maven :

On Linux :

                export MAVEN_OPTS='-Xmx512m'
            

On Windows :

                set MAVEN_OPTS='-Xmx512m'
            

Configure the plugin :

The plugin comes with a lot of possible option to configure:

				
<build>
  <sourceDirectory>path/to/source</sourceDirectory> <!--if different from src/main/java-->
  	<plugins>
  	  <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
  	</plugins>
  </build> 
<reporting>
   <plugins>
       <plugin>
  	     <groupId>net.sf.xradar</groupId>
  		 <artifactId>maven-xradar-plugin</artifactId>
  		 <version>1.2.2</version>
  		 <configuration>
  		   <xradarTarget>${basedir}/releaseStatic/docs/</xradarTarget>
  		   <xradarConfig>${basedir}/etc/xradar-config-default.xml</xradarConfig>
  		   <xradarProperties>${basedir}/etc/default-release.properties</xradarProperties>
  		   <javadocEnabled>true</javadocEnabled>
  		   <debug>true</debug>
  		</configuration>
  	</plugin>
  </plugins>
</reporting>
			
			

You can change any of those parameters. Here is a quick ref:

Parameter Description Default value
autoRadar the automatic mode true
xradarConfig Location of XRadar configuration file ${basedir}/src/main/resources/xradar/radar-config.xml
xradarProperties The xradar's properties ${basedir}/src/main/resources/xradar/release${project.version}.properties
debug The debug mode false
debugMojo The debug mojo mode false
xradarTarget The radar target for docs ${project.build.directory}/site/xradar/
aggregate When running on a multi-modules project, aggregate the report in the parent project false
reportJdepend Location of the generated Jdepend's report ${project.build.directory}/jdepend-report.xml
reportCkjm Location of the generated ckjm's report ${project.build.directory}/ckjm-report.xml
reportCpd Location of the generated cpd's report ${project.build.directory}/cpd.xml
reportPmd Location of the generated pmd's report ${project.build.directory}/pmd.xml
reportFindBugs Location of the generated findbugs' report ${project.build.directory}/findbugs.xml
reportCheckstyle Location of the generated checkstyle's report ${project.build.directory}/checkstyle-result.xml
reportCobertura Location of the generated cobertura's report ${project.build.directory}/site/cobertura/coverage.xml
reportCobertura Location of the generated emma's report ${project.build.directory}/site/emma/coverage.xml
reportJavancss Location of the generated javancss's report ${project.build.directory}/javancss-raw-report.xml
reportJUnit Location of the generated junit's report ${project.build.directory}/junit.xml
enableCkjm true to enable, false to disable true
enablePmd true to enable, false to disable true
enableFindBugs true to enable, false to disable true
enableCpd true to enable, false to disable true
enableCheckstyle true to enable, false to disable true
enableJavancss true to enable, false to disable true
enableCobertura true to enable, false to disable true
enableEmma true to enable, false to disable true
enableJxr true to enable, false to disable true
enableJavadoc true to enable, false to disable true
enableJUnit true to enable, false to disable true
classDirectory Location of the generated classes ${project.build.outputDirectory}

plugins Supported :

plugin name plugin version (automatic mode)
Jdepend 2.9.1 (core version)
Ckjm 0.4
Pmd 2.4
Findbugs 2.0.1
Cpd 2.4
Checkstyle 2.2
Javancss 2.0-beta-2
Cobertura 2.3
Emma 1.0-alpha-1
Jxr 2.1
Javadoc 2.5

old documentation