Class ConfigurationValidationReportTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
io.micronaut.gradle.configuration.validation.tasks.ConfigurationValidationReportTask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

@CacheableTask public abstract class ConfigurationValidationReportTask extends org.gradle.api.DefaultTask
Cacheable task that runs Micronaut configuration validation and writes reports.

This task never fails the build when validation errors are found. Instead, it writes reports and a result marker containing the exit code. A separate ConfigurationValidationTask is responsible for failing the build based on the marker.

Since:
5.0.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Bootstrap main class shipped by micronaut-json-schema-configuration-validator.

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.file.ConfigurableFileCollection
    Application/runtime classpath used to discover schemas and configuration resources.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether environments should be deduced.
    abstract org.gradle.api.provider.Property<Boolean>
    Combined enabled flag (global + scenario).
    abstract org.gradle.api.provider.ListProperty<String>
    Enabled environments.
    protected abstract org.gradle.process.ExecOperations
    Provides the ExecOperations used to run the validator.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether unknown properties are errors.
    abstract org.gradle.api.provider.Property<String>
    Report format (json/html/both).
    abstract org.gradle.api.provider.Property<String>
    Optional Java executable path.
    abstract org.gradle.api.provider.Property<org.gradle.jvm.toolchain.JavaLauncher>
    Optional Java launcher.
    abstract org.gradle.api.file.DirectoryProperty
    Output directory where reports will be generated.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether the scenario classpath overrides the default computed classpath.
    abstract org.gradle.api.file.DirectoryProperty
    Base directory used for rendering stable, relative origin paths.
    abstract org.gradle.api.provider.Property<String>
    Base directory path used for origin rewriting.
    abstract org.gradle.api.provider.ListProperty<String>
    Resource directories (relative to getProjectBaseDir()) used for origin rewriting.
    abstract org.gradle.api.file.RegularFileProperty
    Result marker file containing the CLI exit code and report paths.
    abstract org.gradle.api.provider.ListProperty<String>
    Dependency injection suppression patterns.
    abstract org.gradle.api.provider.ListProperty<String>
    Suppression patterns.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether dependency injection should be validated.
    abstract org.gradle.api.file.ConfigurableFileCollection
    Validator tool classpath (should contain only the validator module).
    final void
    Runs the configuration validator CLI and writes the result marker.

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjects

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Field Details

    • BOOTSTRAP_MAIN_CLASS

      public static final String BOOTSTRAP_MAIN_CLASS
      Bootstrap main class shipped by micronaut-json-schema-configuration-validator.
      See Also:
  • Constructor Details

    • ConfigurationValidationReportTask

      public ConfigurationValidationReportTask()
      Default constructor.
  • Method Details

    • getValidatorClasspath

      @Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getValidatorClasspath()
      Validator tool classpath (should contain only the validator module).
      Returns:
      tool classpath
    • getApplicationClasspath

      @Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getApplicationClasspath()
      Application/runtime classpath used to discover schemas and configuration resources. Passed to the CLI using --classpath.
      Returns:
      application classpath
    • getEnvironments

      @Input public abstract org.gradle.api.provider.ListProperty<String> getEnvironments()
      Enabled environments.
      Returns:
      environments
    • getSuppressions

      @Input public abstract org.gradle.api.provider.ListProperty<String> getSuppressions()
      Suppression patterns.
      Returns:
      suppressions
    • getSuppressedInjectionErrors

      @Input public abstract org.gradle.api.provider.ListProperty<String> getSuppressedInjectionErrors()
      Dependency injection suppression patterns.

      When non-empty, passed to the validator CLI via --suppress-inject-errors <csv>.

      Returns:
      dependency injection suppression patterns
      Since:
      5.1.0
    • getFailOnNotPresent

      @Input public abstract org.gradle.api.provider.Property<Boolean> getFailOnNotPresent()
      Whether unknown properties are errors.
      Returns:
      flag
    • getDeduceEnvironments

      @Input public abstract org.gradle.api.provider.Property<Boolean> getDeduceEnvironments()
      Whether environments should be deduced.
      Returns:
      flag
    • getValidateDependencyInjection

      @Input public abstract org.gradle.api.provider.Property<Boolean> getValidateDependencyInjection()
      Whether dependency injection should be validated.
      Returns:
      flag
    • getFormat

      @Input public abstract org.gradle.api.provider.Property<String> getFormat()
      Report format (json/html/both).
      Returns:
      format
    • getProjectBaseDir

      @Internal public abstract org.gradle.api.file.DirectoryProperty getProjectBaseDir()
      Base directory used for rendering stable, relative origin paths.
      Returns:
      base dir
    • getProjectBaseDirPath

      @Input public abstract org.gradle.api.provider.Property<String> getProjectBaseDirPath()
      Base directory path used for origin rewriting.

      This is an Input rather than an @InputDirectory to avoid snapshotting the full project directory, which would prevent build cache reuse due to unrelated file changes.

      Returns:
      base dir path
    • getResourcesDirs

      @Input public abstract org.gradle.api.provider.ListProperty<String> getResourcesDirs()
      Resource directories (relative to getProjectBaseDir()) used for origin rewriting.
      Returns:
      resource directories
    • getOverrideClasspath

      @Input public abstract org.gradle.api.provider.Property<Boolean> getOverrideClasspath()
      Whether the scenario classpath overrides the default computed classpath.
      Returns:
      override flag
    • getOutputDirectory

      @OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getOutputDirectory()
      Output directory where reports will be generated.
      Returns:
      output directory
    • getResultFile

      @OutputFile public abstract org.gradle.api.file.RegularFileProperty getResultFile()
      Result marker file containing the CLI exit code and report paths.
      Returns:
      marker file
    • getEnabledFlag

      @Internal public abstract org.gradle.api.provider.Property<Boolean> getEnabledFlag()
      Combined enabled flag (global + scenario).
      Returns:
      enabled flag
    • getJavaLauncher

      @Optional public abstract org.gradle.api.provider.Property<org.gradle.jvm.toolchain.JavaLauncher> getJavaLauncher()
      Optional Java launcher.
      Returns:
      java launcher
    • getJavaExecutable

      @Input @Optional public abstract org.gradle.api.provider.Property<String> getJavaExecutable()
      Optional Java executable path.
      Returns:
      executable
    • getExecOperations

      @Inject protected abstract org.gradle.process.ExecOperations getExecOperations()
      Provides the ExecOperations used to run the validator.
      Returns:
      exec operations
    • validateConfiguration

      public final void validateConfiguration() throws IOException
      Runs the configuration validator CLI and writes the result marker.
      Throws:
      IOException - if output cannot be written