I’m trying to write a plugin which enforces some license header at the beginning of each source file.
I followed this guide and it seems to work as expected in the unit tests (raises an issue on files where it’s missing). After importing the plugin to my SonarQube server, I can successfully see the rule description and I am able to add it to my Quality Profile.
What I’m confused about is where the analysis and issue discovery actually happens. While the rule definition does appear in the web interface, it never raises any issues on files missing that header.
I’m running my analysis through GitLab CI/CD, using the gradle plugin (running ./gradlew sonar
). I suspect that I also need to somehow add the plugin on the project side for the issues to be found, but I’m not entirely sure about it, and don’t know how to do so if it is needed.