Search code examples
javasonarqubecheckstylefindbugspmd

checking for illegal imports of remote.entities outside remote package


When the application needs to query a remote system, we often create a “remote” package, with an “entity” sub-package containing classes that will be easier to process the info we retrieve. These classes shouldn’t leak out of the remote package.

Is there any rule available (or under study) to check for importing x.y.remote.entities outside of x.y.remote package?


Solution

  • From your question tags, I see that a Checkstyle based solution would also be helpful to you. The ImportControl check should be just what you need. Checkstyle also features a SonarQube plugin should you require that.