New features :
<reporting> <plugins> ... <plugin> <groupId>net.sf.xradar</groupId> <artifactId>maven-xradar-plugin</artifactId> <version>1.1-beta-1</version> </plugin> </plugins> </reporting>
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.1-beta-1</version> </plugin> </plugins> </reporting>
See the result in the report section of your project's site.
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.1-beta-1</version> <configuration> <autoRadar>true</autoRadar> <!--false to execute only the plugins declared--> </configuration> </plugin> </plugins> </reporting>
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.1-beta-1</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>
To analyse your project, XRadar, and therefore its maven plugin, needs a couple more files:
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 :
<locales>...</locales>
Bug fixes (from 1.1-beta-1) :
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.1-beta-1</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 |
JavadocRoot | The project's Javadoc location | ${project.build.directory}/site/apidocs |
xradarConfig | Location of XRadar configuration file | ${basedir}/src/main/resources/xradar/radar-config.xml |
xradarJava2htmlRoots | The radar Java2htmlRoot | ${project.build.directory}/site/xref |
debug | The debug mode | false |
xradarProperties | The xradar's properties | ${basedir}/src/main/resources/xradar/release${project.version}.properties |
xradarTarget | The radar target for docs | ${basedir}/xradar/release${project.version}/docs/ |
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 |
reportCheckstyle | Location of the generated checkstyle's report | ${project.build.directory}/checkstyle-result.xml |
reportJavancss | Location of the generated javancss's report | ${project.build.directory}/javancss-raw-report.xml |
enableCkjm | true to enable, false to disable | true |
enablePmd | 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 |
enableJxr | true to enable, false to disable | true |
enableJavadoc | true to enable, false to disable | true |
plugin name | plugin version (automatic mode) |
---|---|
Jdepend | 2.9.1 (core version) |
Ckjm | 0.3 |
Pmd | 2.4 |
Cpd | |
Checkstyle | 2.2 |
Javancss | 2.0-beta-2 |
Jxr | 2.1 |
Javadoc | 2.5 |
To use the maven-xradar-plugin, simply add to the pom.xml file to be analysed the following lines:
<reporting> <plugins> <plugin> <groupId>net.sf.xradar</groupId> <artifactId>maven-xradar-plugin</artifactId> <version>0.1</version> </plugin> </plugins> </reporting>
To analyse your project, XRadar, and therefore its maven plugin, needs a couple more files:
You must declare in the pom the plugins report tools you need ( at least JDepend ) from the following :
To have XRadar analysing your project run " mvn site" .
Note, that you can use xradar-config-default.xml and default-release.properties , if you do not have the time to create thoses files.
Add both them in a etc/ folder and rename them
radar-config.xml and xradar.properties or configure
the plugin as shown below.
As the site taks of maven can be quite long, you may want to skip it and only get analysis from xradar. In this case, simply run " mvn net.sf.xradar:maven-xradar-plugin:audit " and see the result in the folder release1.
As soon as your project evolve a little bit you can produce what we called a dynamic analysis that will display how the project quality is evolving !
The plugin comes with a lot of possible option to configure:
<reporting> <plugins> <plugin> <groupId>net.sf.xradar</groupId> <artifactId>maven-xradar-plugin</artifactId> <version>0.1</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> <reportJdepend>${project.build.directory}/resources/jdepend-report.xml</reportJdepend> <reportCkjm>${project.build.directory}/resources/reportCkjm.xml</reportCkjm> <reportCpd>${project.build.directory}/resources/cpd.xml</reportCpd> <reportPmd>${project.build.directory}/resources/pmd.xml</reportPmd> <reportCheckstyle>${project.build.directory}/resources/checkstyle.xml</reportCheckstyle> <reportJavancss>${project.build.directory}/resources/javancss-raw-report.xml</reportJavancss> </configuration> </plugin> </plugins> </reporting>
You can change any of those parameters. Here is a quick ref:
Parameter | Description |
---|---|
JavadocRoot | The project's Javadoc location |
xradarConfig | Location of XRadar configuration file |
xradarJava2htmlRoots | The radar Java2htmlRoot |
debug | The debug mode |
xradarProperties | The xradar's properties |
xradarTarget | The radar target for docs |
reportJdepend | Location of the generated Jdepend's report |
reportCkjm | Location of the generated ckjm's report |
reportCpd | Location of the generated cpd's report |
reportPmd | Location of the generated pmd's report |
reportCheckstyle | Location of the generated checkstyle's report |
reportJavancss | Location of the generated javancss's report |
Warnings: