Overview
Although maven as a popular and powerful tool at the Java industry and it has reduced lots of resources and costs for software projects, but we need some required components in addition to pure technologies such as management,monitoring,integrating. luckily we got a treasure from the open source friends that it's a CI software named Hudson. We integrated more and more components and plugins at Hudson platform usually. but today in this case, our subject is how to configure the automatically reports for PMD,CPD at Hudson platform.
Requirements
- generate reports automatically(PMD,CPD..)
- deployed automatically
- customize configurable
Prepared components
- Installed maven2 and had better with some experiences of maven building. and at least know the concept for M2, else please visit General portal for maven .
- Installed Hudson components. reference is Hudson portal .. xx.
Primary components
- setting.xml
- pom.xml
- maven plugin
setting.xml is the global configurable descriptor for maven, lots of global variable,references,resource locations has been defined at this descriptor. It has been stored at the specified directory under customer profile directory. As this subject, we need do some operations at the setting.xml, every one please follow me. :-)
pom.xml is the primary descriptor for the maven project. I don't want to provide a introduction with pom to my dear friends, but we are unsure that we will modify the pom.xml at the following process.
Architecture for maven reporting
All the generated reports will be stored at the report repository, the special location will have their own reports, so the architecture for maven reporting as below:
Process
step1. set global reporting repository
open the $USER_PROFILE_HOME/.m2/setting.xml at the disk and customize the reporting repository location as below:
also you can used another transfer protocol such as: scp, ftp, https ...
step2. set parameters at pom.xml for report generating
1. Open and edit the pom.xml in the project main folder which named "Master-Build"
add property in the <properties> tag.
2. Set the website property at distributionManagement in pom.xml around all projects , the pattern is "<ubs.site.url.base>/<component.name>/<project.version>/<project.name>" and snapshot as below
3. Add reporting tag after <distributionManagement> tag
step3. copy the reporting configuration to all sub projects
step4. execute maven which goals are: site:site site:deploy
step5. check the issue
go to the location which has been set at setp1, then we can find the reports for the current building. the demo as below:
step6. review issue