Class AutoConfigurationOptimizerPlugin

java.lang.Object
com.patbaumgartner.optimizer.gradle.AutoConfigurationOptimizerPlugin
All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>

public class AutoConfigurationOptimizerPlugin extends Object implements org.gradle.api.Plugin<org.gradle.api.Project>
Gradle plugin for Spring Boot Autoconfiguration Optimizer.

This plugin adds the following tasks:

  • trainAutoconfiguration - Runs the application in training mode to detect which auto-configurations are loaded
  • injectOptimizerCore - Injects the optimizer core classes into the build output before the jar task runs

The autoconfiguration-optimizer-core JAR is automatically added to the training subprocess classpath, so users do not need to declare it as a project dependency. After training the core classes are also injected into the main output directory so they are included in the packaged JAR.

Usage in build.gradle:


 plugins {
     id 'com.patbaumgartner.autoconfiguration-optimizer' version '1.0.0'
 }

 autoconfigurationOptimizer {
     mainClass = 'com.example.MyApplication'
     timeout = 120
 }
 
  • Field Details

    • EXTENSION_NAME

      public static final String EXTENSION_NAME
      The name of the configuration extension registered by this plugin.
      See Also:
    • TRAIN_TASK_NAME

      public static final String TRAIN_TASK_NAME
      The name of the training task registered by this plugin.
      See Also:
    • INJECT_TASK_NAME

      public static final String INJECT_TASK_NAME
      The name of the core-injection task registered by this plugin.
      See Also:
    • TASK_GROUP

      public static final String TASK_GROUP
      The task group under which all plugin tasks are listed.
      See Also:
  • Constructor Details

    • AutoConfigurationOptimizerPlugin

      public AutoConfigurationOptimizerPlugin()
      Creates a new AutoConfigurationOptimizerPlugin.
  • Method Details

    • apply

      public void apply(org.gradle.api.Project project)
      Specified by:
      apply in interface org.gradle.api.Plugin<org.gradle.api.Project>