1
votes

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

1 Answers

1
votes

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)