private SchemaGenerator getGenerator() throws MojoExecutionException {
        if (this.generator == null) {
            this.getLog().debug("Initializing Schema Generator");

            // Start with the generator builder
            SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(this.schemaVersion, this.getOptionPreset());

            // Add options when required
            this.setOptions(configBuilder);

            // Register the modules when specified
            this.setModules(configBuilder);

            // And construct the generator
            SchemaGeneratorConfig config = configBuilder.build();
            this.generator = new SchemaGenerator(config);
        }

        return this.generator;
    }
Get the JSON Schema generator. Create it when required.
<br>
Configuring it the specified options and adding the required modules.

@return The configured generator
@throws MojoExecutionException Error exception
jsonschema-maven-plugin/src/main/java/com/github/victools/jsonschema/plugin/maven/SchemaGeneratorMojo.java