Class SpringBootPropertiesMigratorExtension
java.lang.Object
com.patbaumgartner.spring.migrator.gradle.SpringBootPropertiesMigratorExtension
Project-wide configuration for the analyze and migrate tasks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns when the build should fail:never,manualwhen a finding needs a human, oranyfor any deprecated property at all.Returns the glob patterns, relative to the project directory, selecting the configuration files to inspect.Returns the optional file, relative to the project directory, to write the report to.Returns the Spring Boot version shown in the report.Returns the exact keys or prefixes never to report as unrecognised.Returns the namespaces to inspect for unrecognised keys instead of the Spring Boot ones the check defaults to.Returns whether to report configuration keys that no metadata on the resolved classpath describes:off,report, orfail.booleanisDryRun()Returns whether the migrate task should report without writing anything.voidsetDryRun(boolean dryRun) Sets whether the migrate task should report without writing anything.voidSets when the build should fail.voidsetIncludes(List<String> includes) Sets the glob patterns selecting the configuration files to inspect.voidsetReportFile(String reportFile) Sets the file to write the report to.voidsetSpringBootVersion(String springBootVersion) Sets the Spring Boot version shown in the report.voidsetUnknownKeyExcludes(List<String> unknownKeyExcludes) Sets the exact keys or prefixes never to report as unrecognised.voidsetUnknownKeyIncludes(List<String> unknownKeyIncludes) Sets the namespaces to inspect for unrecognised keys.voidsetUnknownKeys(String unknownKeys) Sets whether to report keys the metadata does not describe.
-
Constructor Details
-
SpringBootPropertiesMigratorExtension
public SpringBootPropertiesMigratorExtension()
-
-
Method Details
-
getIncludes
Returns the glob patterns, relative to the project directory, selecting the configuration files to inspect.- Returns:
- the include patterns
-
setIncludes
Sets the glob patterns selecting the configuration files to inspect.- Parameters:
includes- the include patterns
-
getFailOn
Returns when the build should fail:never,manualwhen a finding needs a human, oranyfor any deprecated property at all.- Returns:
- the failure policy name
-
setFailOn
Sets when the build should fail.- Parameters:
failOn- one ofnever,manualorany
-
getReportFile
Returns the optional file, relative to the project directory, to write the report to.- Returns:
- the report path, or
null
-
setReportFile
Sets the file to write the report to.- Parameters:
reportFile- a path relative to the project directory
-
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
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
Returns whether to report configuration keys that no metadata on the resolved classpath describes:off,report, orfail.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
Sets whether to report keys the metadata does not describe.- Parameters:
unknownKeys- one ofoff,reportorfail
-
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
Sets the namespaces to inspect for unrecognised keys.- Parameters:
unknownKeyIncludes- the namespaces to inspect
-
getUnknownKeyExcludes
Returns the exact keys or prefixes never to report as unrecognised.- Returns:
- the suppressed keys and prefixes
-
setUnknownKeyExcludes
Sets the exact keys or prefixes never to report as unrecognised.- Parameters:
unknownKeyExcludes- the suppressed keys and prefixes
-