{"record":{"id":"6be90020319173ce","repo":"OpenAPITools/openapi-generator","slug":"the-generator-requires-generatorname-refer-to-d","errorCode":null,"errorMessage":"The generator requires 'generatorName'. Refer to documentation for a list of options.","messagePattern":"The generator requires 'generatorName'\\. Refer to documentation for a list of options\\.","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"critical","filePath":"modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java","lineNumber":817,"sourceCode":"            }\n\n            if (enablePostProcessFile != null) {\n                configurator.setEnablePostProcessFile(enablePostProcessFile);\n            }\n\n            if (generateAliasAsModel != null) {\n                configurator.setGenerateAliasAsModel(generateAliasAsModel);\n            }\n\n            if (minimalUpdate != null) {\n                configurator.setEnableMinimalUpdate(minimalUpdate);\n            }\n\n            if (isNotEmpty(generatorName)) {\n                configurator.setGeneratorName(generatorName);\n            } else {\n                LOGGER.error(\"A generator name (generatorName) is required.\");\n                throw new MojoExecutionException(\"The generator requires 'generatorName'. Refer to documentation for a list of options.\");\n            }\n\n            configurator.setOutputDir(output.getAbsolutePath());\n\n            if (isNotEmpty(auth)) {\n                configurator.setAuth(auth);\n            }\n\n            if (isNotEmpty(apiPackage)) {\n                configurator.setApiPackage(apiPackage);\n            }\n\n            if (isNotEmpty(modelPackage)) {\n                configurator.setModelPackage(modelPackage);\n            }\n\n            if (isNotEmpty(invokerPackage)) {\n                configurator.setInvokerPackage(invokerPackage);","sourceCodeStart":799,"sourceCodeEnd":835,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java#L799-L835","documentation":"Thrown by CodeGenMojo when the generate goal has no <generatorName> configured (isNotEmpty check fails). The generator name selects the language/framework (java, python, typescript-fetch, ...), and unlike the CLI the Maven plugin does not prompt for it, so a missing value aborts with this MojoExecutionException pointing at the documentation.","triggerScenarios":"Generate goal configuration with inputSpec set but no <generatorName> element and no -DgeneratorName=... on the command line. Also when the element is typo'd (<generateName>, <generator>) or when the configuration is inherited from a parent POM's pluginManagement that never defined it.","commonSituations":"First-time adoption from a minimal example; renaming the property by hand; multi-module builds where one module lacks the inherited configuration; CI invoking the goal directly (mvn openapi-generator:generate) so the POM-bound execution config is bypassed.","solutions":["Add <generatorName>java</generatorName> (or your target generator) to the plugin configuration.","List installed generators with mvn org.openapitools:openapi-generator-maven-plugin:help or openapi-generator-cli list to confirm the exact name.","If invoking the goal from the CLI, pass -DgeneratorName=java instead of relying on POM defaults.","In multi-module builds, put common config in pluginManagement and the generatorName in each module."],"exampleFix":"<!-- before -->\n<configuration>\n  <inputSpec>${project.basedir}/api.yaml</inputSpec>\n  <output>${project.build.directory}/generated-sources</output>\n</configuration>\n\n<!-- after -->\n<configuration>\n  <inputSpec>${project.basedir}/api.yaml</inputSpec>\n  <generatorName>java</generatorName>\n  <output>${project.build.directory}/generated-sources</output>\n</configuration>","handlingStrategy":"validation","validationCode":"# CI: assert every openapi-generator generate execution declares a generatorName\nfor pom in $(git ls-files '*/pom.xml' pom.xml); do\n  grep -q 'openapi-generator-maven-plugin' \"$pom\" || continue\n  grep -q '<generatorName>' \"$pom\" || { echo \"$pom: missing generatorName\"; exit 1; }\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set <generatorName> explicitly; never assume a default exists in the Maven plugin.","Confirm exact generator names via openapi-generator-cli list (or the help goal) before writing them into the POM.","In multi-module builds, keep generatorName per module and shared options in pluginManagement.","When invoking the goal directly on the CLI, pass -DgeneratorName=... to mirror the POM."],"tags":["openapi-generator","maven","plugin-config","missing-parameter","generator-selection"],"backgroundTag":"missing-required-config","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}