{"record":{"id":"488d71b4cc4d884e","repo":"quarkusio/quarkus","slug":"bad-identifier-formatted-with-groupid-and-proj","errorCode":null,"errorMessage":"${BAD_IDENTIFIER formatted with 'groupId' and projectGroupId}","messagePattern":"\\$\\{BAD_IDENTIFIER formatted with 'groupId' and projectGroupId\\}","errorType":"validation","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java","lineNumber":295,"sourceCode":"            } else if (containsAtLeastOneGradleFile) {\n                throw new MojoExecutionException(\n                        \"You are trying to create a Maven project in a directory that contains only Gradle build files.\");\n            }\n        } else if (BuildTool.GRADLE.equals(buildToolEnum) || BuildTool.GRADLE_KOTLIN_DSL.equals(buildToolEnum)) {\n            if (containsAtLeastOneGradleFile) {\n                throw new MojoExecutionException(\"Adding subprojects to gradle projects is not implemented.\");\n            } else if (pom != null && pom.isFile()) {\n                throw new MojoExecutionException(\n                        \"You are trying to create gradle project in a directory that contains only maven build files.\");\n            }\n        }\n\n        askTheUserForMissingValues();\n        if (!DEFAULT_ARTIFACT_ID.equals(projectArtifactId) && !OK_ID.matcher(projectArtifactId).matches()) {\n            throw new MojoExecutionException(String.format(BAD_IDENTIFIER, \"artifactId\", projectArtifactId));\n        }\n        if (!DEFAULT_GROUP_ID.equals(projectGroupId) && !OK_ID.matcher(projectGroupId).matches()) {\n            throw new MojoExecutionException(String.format(BAD_IDENTIFIER, \"groupId\", projectGroupId));\n        }\n\n        projectRoot = new File(outputDirectory, projectArtifactId);\n        if (projectRoot.exists()) {\n            throw new MojoExecutionException(\"Unable to create the project, \" +\n                    \"the directory \" + projectRoot.getAbsolutePath() + \" already exists\");\n        }\n\n        boolean success;\n        final Path projectDirPath = projectRoot.toPath();\n        try {\n            extensions = CreateProjectHelper.sanitizeExtensions(extensions);\n            catalog = CreateProjectHelper.completeCatalog(catalog, extensions, mvn);\n            sanitizeOptions();\n\n            final List<ResourceLoader> codestartsResourceLoader = codestartLoadersBuilder(log)\n                    .catalog(catalog)\n                    .artifactResolver(mvn)","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java#L277-L313","documentation":"Same validation as the artifactId check but applied to the project groupId: after user input, the mojo validates projectGroupId against the OK_ID regex and throws a MojoExecutionException via the BAD_IDENTIFIER template when it does not match a valid Java package-style identifier. GroupIds must be reverse-domain style package names (letters, digits, dots, hyphens/underscores in segments).","triggerScenarios":"`mvn quarkus:create -DprojectGroupId=\"com.example corp\"` or entering an invalid groupId interactively.","commonSituations":"GroupIds containing spaces, underscores at bad positions, symbols like `#`, or team names with slashes; copy-paste errors from documentation.","solutions":["Use a valid reverse-domain groupId, e.g. -DprojectGroupId=com.example.myteam","Re-run and correct the value at the interactive prompt","Normalize the groupId in scripts (lowercase, dots instead of spaces/slashes)"],"exampleFix":"// before\nmvn quarkus:create -DprojectGroupId=\"com example\"\n// after\nmvn quarkus:create -DprojectGroupId=com.example","handlingStrategy":"validation","validationCode":"Pattern OK_ID = Pattern.compile(\"^[a-zA-Z][a-zA-Z0-9_]*(\\\\.[a-zA-Z][a-zA-Z0-9_]*)*$\");\nif (!OK_ID.matcher(groupId).matches()) throw new IllegalArgumentException(\"Invalid groupId: \" + groupId);","typeGuard":null,"tryCatchPattern":"try {\n    runCreateGoal();\n} catch (MojoExecutionException e) {\n    if (e.getMessage().contains(\"groupId\")) {\n        // retry with a reverse-domain style groupId\n    }\n}","preventionTips":["Use reverse-domain groupIds like com.example.team","Strip spaces/symbols from team names before scripting","Validate against the OK_ID pattern before invoking the goal"],"tags":["validation","naming-convention","maven"],"backgroundTag":"invalid-identifier","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}