All of my SonarQube code analysis Java projects are failing on this rule.
Each source file should start with a header stating file ownership and the license which must be used to distribute the application. This rule must be fed with the header text that is expected at the beginning of every file.
There is one parameter:
headerFormat Expected copyright and license header (plain text)
But there are no examples of how this should be configured. By default headerFormat is empty and I cannot find documentation on configuring this rule.
I'm guessing there should be some kind of regular expression or template language that can be used?
only change the default text for "headerFormat" on SonarQube server:
squid:S1451 "Copyright and license headers should be defined" has two parameters:
In headerFormat you define expected text. If you set isRegularExpression to true, then the text will be treated as regular expression.
If you use normal text, then you need to put full license, e.g.:
If you use regular expression, then you can omit some parts, e.g.: