Class OpenApiServerMojo

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-server", defaultPhase=GENERATE_SOURCES) public class OpenApiServerMojo extends AbstractOpenApiMojo
Generates an OpenAPI server. The sources are generated in the target directory.
  • Field Details

    • MOJO_NAME

      public static final String MOJO_NAME
      See Also:
    • controllerPackageName

      @Parameter(property="micronaut.openapi.server.controller.package.name", defaultValue="io.micronaut.openapi.controller.package.name", required=true) protected String controllerPackageName
      The package name of the controller if controller implementation files are generated.
    • useAuth

      @Parameter(property="micronaut.openapi.server.use.auth", defaultValue="false") protected boolean useAuth
      Whether to generate authentication annotations for APIs.
    • lombok

      @Parameter(property="micronaut.openapi.server.lombok") protected boolean lombok
      Determines if the server should use lombok.
      Since:
      4.2.2
    • fluxForArrays

      @Parameter(property="micronaut.openapi.server.flux.for.arrays") protected boolean fluxForArrays
      Determines if the server should use flux for arrays.
      Since:
      4.2.2
    • generatedAnnotation

      @Parameter(property="micronaut.openapi.server.generated.annotation", defaultValue="true") protected boolean generatedAnnotation
      If set to true, the `javax.annotation.Generated` annotation will be added to all generated classes.
      Since:
      4.2.2
    • aotCompatible

      @Parameter(property="micronaut.openapi.server.aot.compatible") protected boolean aotCompatible
      If set to true, the generated code should be made compatible with Micronaut AOT.
      Since:
      4.2.2
    • enabled

      @Parameter(property="micronaut.openapi.generate.server") protected boolean enabled
      The property that defines if this mojo should be used in configuration.
  • 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)
      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