Class SpringBootPropertiesMigratorExtension

java.lang.Object
com.patbaumgartner.spring.migrator.gradle.SpringBootPropertiesMigratorExtension

public class SpringBootPropertiesMigratorExtension extends Object
Project-wide configuration for the analyze and migrate tasks.
  • Constructor Details

    • SpringBootPropertiesMigratorExtension

      public SpringBootPropertiesMigratorExtension()
  • Method Details

    • getIncludes

      public List<String> getIncludes()
      Returns the glob patterns, relative to the project directory, selecting the configuration files to inspect.
      Returns:
      the include patterns
    • setIncludes

      public void setIncludes(List<String> includes)
      Sets the glob patterns selecting the configuration files to inspect.
      Parameters:
      includes - the include patterns
    • getFailOn

      public String getFailOn()
      Returns when the build should fail: never, manual when a finding needs a human, or any for any deprecated property at all.
      Returns:
      the failure policy name
    • setFailOn

      public void setFailOn(String failOn)
      Sets when the build should fail.
      Parameters:
      failOn - one of never, manual or any
    • getReportFile

      public String getReportFile()
      Returns the optional file, relative to the project directory, to write the report to.
      Returns:
      the report path, or null
    • setReportFile

      public void setReportFile(String reportFile)
      Sets the file to write the report to.
      Parameters:
      reportFile - a path relative to the project directory
    • getSpringBootVersion

      public String getSpringBootVersion()
      Returns the Spring Boot version shown in the report. Metadata is always read from the resolved project classpath, so this does not change what gets detected.
      Returns:
      the version override, or null
    • setSpringBootVersion

      public void setSpringBootVersion(String springBootVersion)
      Sets the Spring Boot version shown in the report.
      Parameters:
      springBootVersion - the version to display
    • isDryRun

      public boolean isDryRun()
      Returns whether the migrate task should report without writing anything.
      Returns:
      whether to run dry
    • setDryRun

      public void setDryRun(boolean dryRun)
      Sets whether the migrate task should report without writing anything.
      Parameters:
      dryRun - whether to run dry
    • getUnknownKeys

      public String getUnknownKeys()
      Returns whether to report configuration keys that no metadata on the resolved classpath describes: off, report, or fail.

      This is advisory. A key can be absent because Spring Boot removed it, or simply because the code that reads it publishes no metadata, so it never rewrites or removes anything and never affects failOn.

      Returns:
      the unknown key policy name
    • setUnknownKeys

      public void setUnknownKeys(String unknownKeys)
      Sets whether to report keys the metadata does not describe.
      Parameters:
      unknownKeys - one of off, report or fail
    • getUnknownKeyIncludes

      public List<String> getUnknownKeyIncludes()
      Returns the namespaces to inspect for unrecognised keys instead of the Spring Boot ones the check defaults to.
      Returns:
      the namespaces to inspect
    • setUnknownKeyIncludes

      public void setUnknownKeyIncludes(List<String> unknownKeyIncludes)
      Sets the namespaces to inspect for unrecognised keys.
      Parameters:
      unknownKeyIncludes - the namespaces to inspect
    • getUnknownKeyExcludes

      public List<String> getUnknownKeyExcludes()
      Returns the exact keys or prefixes never to report as unrecognised.
      Returns:
      the suppressed keys and prefixes
    • setUnknownKeyExcludes

      public void setUnknownKeyExcludes(List<String> unknownKeyExcludes)
      Sets the exact keys or prefixes never to report as unrecognised.
      Parameters:
      unknownKeyExcludes - the suppressed keys and prefixes