Class OpenApiGenericMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="generate-openapi-generic", defaultPhase=GENERATE_SOURCES) public class OpenApiGenericMojo extends AbstractOpenApiMojo
A generic OpenAPI mojo that will be used for configuring custom Micronaut OpenAPI generator extensions.
  • Field Details

    • MOJO_NAME

      public static final String MOJO_NAME
      See Also:
    • CONFIGURATION_PROPERTIES

      public static final String CONFIGURATION_PROPERTIES
      See Also:
    • generatorClassName

      @Parameter(property="micronaut.openapi.generator.builder.classname") protected String generatorClassName
      The classname of the generator to be used for code generation.

      The generator must property overwrite the MicronautCodeGenerator.optionsBuilder() method and the builder should have setters or withers for the properties to be used in maven configuration.

    • properties

      @Parameter(property="micronaut.openapi.generator.properties") protected Map<String,String> properties
      The configuration properties that will be passed on to the custom generator options builder.

      Any configuration parameters with key micronaut.openapi.generator.properties.[PROPERTY_NAME] will be passed on to the generator options builder. String, integer and boolean value types are supported for additional properties.

  • Constructor Details

  • Method Details

    • isEnabled

      protected boolean isEnabled()
      Description copied from class: AbstractOpenApiMojo
      Determines if this mojo must be executed.
      Specified by:
      isEnabled in class AbstractOpenApiMojo
      Returns:
      true if the mojo is enabled
    • configureBuilder

      protected void configureBuilder(io.micronaut.openapi.generator.MicronautCodeGeneratorBuilder builder) throws org.apache.maven.plugin.MojoExecutionException
      Description copied from class: AbstractOpenApiMojo
      Configures the OpenAPI generator. When this method is called, common properties shared by all generators have already been configured, so this method should only take care of configuring the generator specific parameters.
      Specified by:
      configureBuilder in class AbstractOpenApiMojo
      Parameters:
      builder - the generator configuration builder
      Throws:
      org.apache.maven.plugin.MojoExecutionException