Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 sealightsJvmParamssection .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 like full, or scanonly. It does not apply to testonly.

  • You can declare this system property into a buildScannerParams section rather than the generic sealightsJvmParams. 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

  1. May be an exact value or a regular expression

  2. A sign '$' in the nested class pattern will not be handled as a regex special character, but as a part of the name

  3. 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

  1. The custom methods filter is applied after the files filter: it is applied to files and packages that were included.

  2. 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.

...