Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven plugin to restrict specific packages from being used

I work in a team of around 40 developers, and I do not want any developer to use some specific API(java.sun.Base64 to be precise) to be used by any of the developers and rather make them use alternatives to the sun API as its proprietary.

Are there any plugins for maven, by which , specifying the restricted packages in the pom.xml , the build will break if any of those packages are being used anywhere in the code??

Or is there a more graceful way to do this??

Thanks

like image 540
Neeraj Avatar asked Sep 19 '11 07:09

Neeraj


1 Answers

You want to define an architectural rule for your project, which is best enforced by source code analysis.

Sonar now has the ability to specify such rules and display violations on the project's quality dashboard. If you want the build to break, this can additionally be done enabling Sonar's Build breaker plug-in.

Sonar is really easy to setup and integrates into your Maven build process with zero change to your POM.

like image 122
Mark O'Connor Avatar answered Sep 23 '22 05:09

Mark O'Connor