...
Info |
---|
For build scanner command and parameter usage refer to SeaLights Java agent - Command Reference. |
Sealights plugins configuration
A custom filter file may be provided as a system property sl.customFilterFile
inside the sealightsJvmParams
section .The pom in the JSON file for the Maven or Gradle plugins. Here is a relevant JSON file fragment example:
Code Block |
---|
<sealightsJvmParams>"sealightsJvmParams": { <sl.customFilterFile>config/CustomFilter.json</sl.customFilterFile> </sealightsJvmParams>"sl.customFilterFile": "config/CustomFilter.json" } |
This parameter is only relevant to an
executionType
that executes the scanner likefull
, orscanonly
. It does not apply totestonly
.You can declare this system property into a
buildScannerParams
section rather than the genericsealightsJvmParams
. This way it will not be passed to java commands other than the build scanner during the Maven execution.
Custom Filter Sample file
...
Class name pattern notation
May be an exact value or a regular expression
A sign '$' in the nested class pattern will not be handled as a regex special character, but as a part of the name
A pattern should not contain a file extension
Example:
Apply for class MyClass and any nested class of MyClass:
...
Code Block |
---|
public .* get[A-Z]*() *calculate(int, boolean, List) * run(.*) |
Filter handling
The custom methods filter is applied after the files filter: it is applied to files and packages that were included.
Include rules are intended to add “exceptions” to exclude rules and are checked first. If a particular method matches any include rule, it will not be excluded
Note |
---|
If the same pattern appears in includes and excludes, the include rule always overwrites the exclusion and the appropriate method will not be excluded. |
...