I want to exclude the folder with the tests from the static code analysis. I tried to define the following in the pom.xml. I also tested with the path src/test/**. However, the tests folder is still analyzed.
** means 0-n directories. So **src doesn’t make sense to the analyzer as a path. On the other hand, **/src would.
That said, test files are automatically excluded from most calculations including both coverage and license-LoC. So a better approach would be to get those files properly identified by analysis as test files. Since the tests appear to live side-by-side with your source files, that’s a multi-step operation (or rather, a multi-parameter operation). It would look something like this:
That last line keeps the test files from being double-counted as both tests and source files. And of course, you’ll want to adjust those paths to match your project.