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 Details

    • outputFile

      @Parameter(defaultValue="${project.build.directory}/java-to-zod/${project.artifactId}-schemas.js", required=true) public File outputFile
      Path and name of generated file.
    • schemaNamePrefix

      @Parameter public String schemaNamePrefix
      Prefix added to generated schema names.
    • schemaNameSuffix

      @Parameter(defaultValue="Schema") public String schemaNameSuffix
      Suffix added to generated schema names.
    • classes

      @Parameter public List<String> classes
      Classes to process.
    • classPatterns

      @Parameter public List<String> 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.
      For more information and examples see Class Names Glob Patterns Wiki page.
    • classesWithAnnotations

      @Parameter public List<String> classesWithAnnotations
      Classes to process specified by annotations.
    • classesImplementingInterfaces

      @Parameter public List<String> classesImplementingInterfaces
      Classes to process specified by implemented interface.
    • classesExtendingClasses

      @Parameter public List<String> classesExtendingClasses
      Classes to process specified by extended superclasses.
    • classesFromJaxrsApplication

      @Parameter public String classesFromJaxrsApplication
      Scans specified JAX-RS Application for classes to process. Parameter contains fully-qualified class name. It is possible to exclude particular REST resource classes using excludeClasses parameter.
    • classesFromAutomaticJaxrsApplication

      @Parameter public boolean classesFromAutomaticJaxrsApplication
      Scans JAX-RS resources for JSON classes to process. It is possible to exclude particular REST resource classes using excludeClasses parameter.
    • scanningAcceptedPackages

      @Parameter public List<String> scanningAcceptedPackages
      Allows to speed up classpath scanning by limiting scanning to specified packages. This optimization applies to following parameters:
      • classPatterns
      • classesImplementingInterfaces
      • classesExtendingClasses
      • classesWithAnnotations
      • classesFromAutomaticJaxrsApplication
      This parameter is passed directly to underlying classpath scanning library (ClassGraph) without any validation or interpretation.
    • excludeClasses

      @Parameter public List<String> excludeClasses
      List of classes excluded from processing.
    • excludeClassPatterns

      @Parameter public List<String> excludeClassPatterns
      Excluded classes specified using glob patterns. For more information and examples see Class Names Glob Patterns Wiki page.
    • includePropertyAnnotations

      @Parameter public List<String> includePropertyAnnotations
      If this list is not empty then only properties with any of these annotations will be included.
    • excludePropertyAnnotations

      @Parameter public List<String> excludePropertyAnnotations
      Properties with any of these annotations will be excluded.
    • jsonLibrary

      @Parameter(required=true) public cz.habarta.typescript.generator.JsonLibrary jsonLibrary
      Library used in JSON classes. Supported values are:
      • jackson2 - annotations from `com.fasterxml.jackson.annotation` package
      • jaxb - annotations from `javax.xml.bind.annotation` package
      • gson - annotations from `com.google.gson.annotations` package
      • jsonb - annotations from `javax.json.bind.annotation` package
      Required parameter, recommended value is jackson2.
    • jackson2Configuration

      @Parameter public cz.habarta.typescript.generator.Jackson2Configuration jackson2Configuration
      Specifies Jackson 2 global configuration. Description of individual parameters is in Jackson2Configuration class on GitHub (latest version).
    • gsonConfiguration

      @Parameter public cz.habarta.typescript.generator.GsonConfiguration gsonConfiguration
      Specifies Gson global configuration. Description of individual parameters is in GsonConfiguration class on GitHub (latest version).
    • jsonbConfiguration

      @Parameter public cz.habarta.typescript.generator.JsonbConfiguration jsonbConfiguration
      Specifies JSON-B global configuration. Description of individual parameters is in Jackson2Configuration class on GitHub (latest version).
    • scanSpringApplication

      @Parameter public boolean scanSpringApplication
      If true Spring REST application will be loaded and scanned for classes to process. It is needed to specify application class using another parameter (for example classes).
    • loggingLevel

      @Parameter public cz.habarta.typescript.generator.Logger.Level loggingLevel
      Specifies level of logging output. Supported values are:
      • Debug
      • Verbose
      • Info
      • Warning
      • Error
      Default value is 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