Class FrontendScannerConfig

java.lang.Object
com.vaadin.flow.plugin.maven.FrontendScannerConfig

@Cloneable public class FrontendScannerConfig extends Object
Configuration class for filtering Maven artifacts to be scanned by the plugin. This class allows enabling or disabling the scanner and defining inclusion and exclusion rules.

Exclusions have higher priority and are checked first. If an artifact matches an exclusion rule, it is not scanned. If no exclusion rule applies, inclusion rules are evaluated. If the artifact doesn't even match the inclusion rule, it is not scanned.
  • Constructor Details

    • FrontendScannerConfig

      public FrontendScannerConfig()
      Creates a new empty configuration, accepting all artifacts.
  • Method Details

    • setEnabled

      public void setEnabled(boolean enabled)
      Sets whether the frontend scanner is enabled or not.
      Parameters:
      enabled - true to enable frontend scan filtering, otherwise false.
    • isEnabled

      public boolean isEnabled()
      Indicates whether the frontend scanning filtering is enabled. Default is true.
      Returns:
      true if frontend scanning filtering is enabled, otherwise false.
    • setIncludeOutputDirectory

      public void setIncludeOutputDirectory(boolean includeOutputDirectory)
      Sets if the output directory should be included in the scan.

      Can be turned on to make scanning faster if the maven module itself does not have classes referencing frontend resources or Vaadin components or add-ons.
      Parameters:
      includeOutputDirectory - true to scan output directory, otherwise false.
    • isIncludeOutputDirectory

      public boolean isIncludeOutputDirectory()
      Determines if the output directory should be included in the scan. Default is true.
      Returns:
      true if output directory should be included in the scan, otherwise false.
    • setScannerMode

      public void setScannerMode(FrontendScannerConfig.AnnotationScannerMode scannerMode)
      Sets the annotation scanner mode.

      The scanner mode determines which JARs are scanned for Vaadin annotations:

      • ADD_ON - Only scan JARs with Vaadin-Package-Version manifest attribute (recommended for performance)
      • FULL - Scan all JARs (legacy behavior, default)
      Parameters:
      scannerMode - the scanner mode to use, not null
    • getScannerMode

      Gets the annotation scanner mode. Default is FULL.
      Returns:
      the scanner mode
    • getExcludes

      Gets the list of artifact matchers specifying which artifacts should be excluded from the scan.
      Returns:
      the list of artifact exclusions.
    • addExclude

      public void addExclude(FrontendScannerConfig.ArtifactMatcher artifactMatcher)
      Adds an artifact matcher to the exclude list.
      Parameters:
      artifactMatcher - the artifact matcher to be excluded, not null.
    • getIncludes

      Gets the ist of artifact matchers specifying which artifacts should be included in the scan.
      Returns:
      the list of artifact inclusions.
    • addInclude

      public void addInclude(FrontendScannerConfig.ArtifactMatcher artifactMatcher)
      Adds an artifact matcher to the include list.
      Parameters:
      artifactMatcher - the artifact matcher to be included, not null.
    • toString

      public String toString()
      Overrides:
      toString in class Object