How to hook PMD + Clover in Hudson build using maven?

℡╲_俬逩灬. 提交于 2019-12-08 06:26:23

问题


we have newly set-up up a Hudson (yes.. Hudson, not Jenkins) CI. The job scheduled in Hudson does the following

a. Connects to IBM ClearCase repository to download the latest source code
b. Compiles all java source code and Creates a WAR file (by running the project's pom.xml)
c. Deploys it to a Tomcat6 server

Now, i want to take it one more step further in-terms of bringing in automatic 'Static Code Analyzers' in this process.

I installed PMD/Clover/JavaNCSS plugins in my Hudson instance, but while looking at it's setting, it looks like, these plugins will not perform the static code analyzing. Instead they will just depend upon the reports generated by Maven-PMD/Clover/JavaNCSS plugins and then display them.

But, i was aiming to create the set-up in such a way to Fail the Build if the PMD/Clover/JavaNCSS checks result in violations beyond a threshold limit.

Could anyone let me know how to proceed futher ?

Note: If this works fine, next i would like to stop developers from checking-in their code into ClearCase in-case of any coding standard violations. Any pointers on this ?


回答1:


stop developers from checking-in their code into ClearCase in-case of any coding standard violations

That means locking.
Either locking the UCM stream (if you are using ClearCase UCM) or locking the branch which is monitored by your Hudson.
See cleartool lock.

The idea is to prevent anyone to checkout/checking (except the account used by the Hudson if it needs to modify any file)


On the "failed build" part, a plugin like Conditional BuildStep Plugin might help (a Jenkins one, but it could be ported for Hudson too)



来源:https://stackoverflow.com/questions/11657620/how-to-hook-pmd-clover-in-hudson-build-using-maven

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!