Package sh.ivan.zod
Class GenerateZodSchemasMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
sh.ivan.zod.GenerateZodSchemasMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="generate",
defaultPhase=PROCESS_CLASSES,
requiresDependencyResolution=COMPILE,
threadSafe=true)
public class GenerateZodSchemasMojo
extends org.apache.maven.plugin.AbstractMojo
Generates Zod schemas from specified java classes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionClasses to process.Classes to process specified by extended superclasses.booleanScans JAX-RS resources for JSON classes to process.Scans specified JAX-RSApplicationfor classes to process.Classes to process specified by implemented interface.Classes to process specified by annotations.Classes to process specified using glob patterns so it is possible to specify package or class name suffix.List of classes excluded from processing.Excluded classes specified using glob patterns.Properties with any of these annotations will be excluded.cz.habarta.typescript.generator.GsonConfigurationSpecifies Gson global configuration.If this list is not empty then only properties with any of these annotations will be included.cz.habarta.typescript.generator.Jackson2ConfigurationSpecifies Jackson 2 global configuration.cz.habarta.typescript.generator.JsonbConfigurationSpecifies JSON-B global configuration.cz.habarta.typescript.generator.JsonLibraryLibrary used in JSON classes.cz.habarta.typescript.generator.Logger.LevelSpecifies level of logging output.Path and name of generated file.org.apache.maven.project.MavenProjectAllows to speed up classpath scanning by limiting scanning to specified packages.booleanIftrueSpring REST application will be loaded and scanned for classes to process.Prefix added to generated schema names.Suffix added to generated schema names.booleanFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
outputFile
@Parameter(defaultValue="${project.build.directory}/java-to-zod/${project.artifactId}-schemas.js", required=true) public File outputFilePath and name of generated file. -
schemaNamePrefix
Prefix added to generated schema names. -
schemaNameSuffix
Suffix added to generated schema names. -
classes
Classes to process. -
classPatterns
Classes to process specified using glob patterns so it is possible to specify package or class name suffix. Glob patterns support two wildcards:- Single
*wildcard matches any character except for.and$. - Double
**wildcard matches any character.
- Single
-
classesWithAnnotations
Classes to process specified by annotations. -
classesImplementingInterfaces
Classes to process specified by implemented interface. -
classesExtendingClasses
Classes to process specified by extended superclasses. -
classesFromJaxrsApplication
Scans specified JAX-RSApplicationfor classes to process. Parameter contains fully-qualified class name. It is possible to exclude particular REST resource classes usingexcludeClassesparameter. -
classesFromAutomaticJaxrsApplication
@Parameter public boolean classesFromAutomaticJaxrsApplicationScans JAX-RS resources for JSON classes to process. It is possible to exclude particular REST resource classes usingexcludeClassesparameter. -
scanningAcceptedPackages
Allows to speed up classpath scanning by limiting scanning to specified packages. This optimization applies to following parameters:classPatternsclassesImplementingInterfacesclassesExtendingClassesclassesWithAnnotationsclassesFromAutomaticJaxrsApplication
-
excludeClasses
List of classes excluded from processing. -
excludeClassPatterns
Excluded classes specified using glob patterns. For more information and examples see Class Names Glob Patterns Wiki page. -
includePropertyAnnotations
If this list is not empty then only properties with any of these annotations will be included. -
excludePropertyAnnotations
Properties with any of these annotations will be excluded. -
jsonLibrary
@Parameter(required=true) public cz.habarta.typescript.generator.JsonLibrary jsonLibraryLibrary used in JSON classes. Supported values are:jackson2- annotations from `com.fasterxml.jackson.annotation` packagejaxb- annotations from `javax.xml.bind.annotation` packagegson- annotations from `com.google.gson.annotations` packagejsonb- annotations from `javax.json.bind.annotation` package
jackson2. -
jackson2Configuration
@Parameter public cz.habarta.typescript.generator.Jackson2Configuration jackson2ConfigurationSpecifies Jackson 2 global configuration. Description of individual parameters is in Jackson2Configuration class on GitHub (latest version). -
gsonConfiguration
@Parameter public cz.habarta.typescript.generator.GsonConfiguration gsonConfigurationSpecifies Gson global configuration. Description of individual parameters is in GsonConfiguration class on GitHub (latest version). -
jsonbConfiguration
@Parameter public cz.habarta.typescript.generator.JsonbConfiguration jsonbConfigurationSpecifies JSON-B global configuration. Description of individual parameters is in Jackson2Configuration class on GitHub (latest version). -
scanSpringApplication
@Parameter public boolean scanSpringApplicationIftrueSpring REST application will be loaded and scanned for classes to process. It is needed to specify application class using another parameter (for exampleclasses). -
loggingLevel
@Parameter public cz.habarta.typescript.generator.Logger.Level loggingLevelSpecifies level of logging output. Supported values are:DebugVerboseInfoWarningError
Verbose. -
skip
@Parameter(property="java.to.zod.skip") public boolean skip -
project
@Parameter(defaultValue="${project}", readonly=true, required=true) public org.apache.maven.project.MavenProject project -
projectBuildDirectory
@Parameter(defaultValue="${project.build.directory}", readonly=true, required=true) public String projectBuildDirectory
-
-
Constructor Details
-
GenerateZodSchemasMojo
public GenerateZodSchemasMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-