Package io.micronaut.maven.openapi
Class OpenApiGenericMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
io.micronaut.maven.AbstractMicronautMojo
io.micronaut.maven.openapi.AbstractOpenApiMojo
io.micronaut.maven.openapi.OpenApiGenericMojo
- 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 Summary
Modifier and TypeFieldDescriptionstatic final String
protected String
The classname of the generator to be used for code generation.static final String
The configuration properties that will be passed on to the custom generator options builder.Fields inherited from class io.micronaut.maven.openapi.AbstractOpenApiMojo
additionalEnumTypeAnnotations, additionalModelTypeAnnotations, additionalOneOfTypeAnnotations, additionalProperties, allowUnicodeIdentifiers, alwaysUseGenerateHttpResponse, apiNamePrefix, apiNameSuffix, apiPackageName, dateTimeFormat, definitionFile, ensureUniqueParams, enumNameMapping, generateHttpResponseWhereRequired, generateSwaggerAnnotations, implicitHeaders, implicitHeadersRegex, importMapping, inlineSchemaNameMapping, inlineSchemaOption, invokerPackageName, ksp, lang, modelNameMapping, modelNamePrefix, modelNameSuffix, modelPackageName, nameMapping, openapiNormalizer, outputDirectory, outputKinds, parameterMappings, prependFormOrBodyParameters, project, removeOperationIdPrefixCount, removeOperationIdPrefixDelimiter, responseBodyMappings, schemaMapping, serializationFramework, skipOperationExample, skipSortingOperations, sortModelPropertiesByRequiredFlag, sortParamsByRequiredFlag, typeMapping, useBeanValidation, useEnumCaseInsensitive, useJakartaEe, useOneOfInterfaces, useOptional, useReactive
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
configureBuilder
(io.micronaut.openapi.generator.MicronautCodeGeneratorBuilder builder) Configures the OpenAPI generator.protected boolean
Determines if this mojo must be executed.Methods inherited from class io.micronaut.maven.openapi.AbstractOpenApiMojo
execute
Methods inherited from class io.micronaut.maven.AbstractMicronautMojo
setLog
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setPluginContext
-
Field Details
-
MOJO_NAME
- See Also:
-
CONFIGURATION_PROPERTIES
- See Also:
-
generatorClassName
@Parameter(property="micronaut.openapi.generator.builder.classname") protected String generatorClassNameThe 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> propertiesThe 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
-
OpenApiGenericMojo
public OpenApiGenericMojo()
-
-
Method Details
-
isEnabled
Description copied from class:AbstractOpenApiMojo
Determines if this mojo must be executed.- Specified by:
isEnabled
in classAbstractOpenApiMojo
- 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 classAbstractOpenApiMojo
- Parameters:
builder
- the generator configuration builder- Throws:
org.apache.maven.plugin.MojoExecutionException
-