{"record":{"id":"d30740006fa1721a","repo":"quarkusio/quarkus","slug":"referenceartifact-must-be-in-format-groupid-artif","errorCode":null,"errorMessage":"referenceArtifact must be in format 'groupId:artifactId:version', got: ${referenceArtifact}","messagePattern":"referenceArtifact must be in format 'groupId:artifactId:version', got: (.+?)","errorType":"validation","errorClass":"EnforcerRuleException","httpStatus":null,"severity":"error","filePath":"independent-projects/enforcer-rules/src/main/java/io/quarkus/enforcer/DependencyAlignmentRule.java","lineNumber":77,"sourceCode":"        this.dependencies = dependencies;\n    }\n\n    @Override\n    public void execute() throws EnforcerRuleException {\n        // Validate configuration\n        if (referenceArtifact == null || referenceArtifact.trim().isEmpty()) {\n            throw new EnforcerRuleException(\n                    \"referenceArtifact must be configured (e.g., 'org.hibernate.orm:hibernate-platform:7.3.0.Final')\");\n        }\n        if (dependencies == null || dependencies.isEmpty()) {\n            getLog().warn(\"No dependencies configured for alignment check\");\n            return;\n        }\n\n        // Parse the reference artifact GAV\n        String[] parts = referenceArtifact.split(\":\");\n        if (parts.length != 3) {\n            throw new EnforcerRuleException(\n                    \"referenceArtifact must be in format 'groupId:artifactId:version', got: \" + referenceArtifact);\n        }\n        String referenceGroupId = parts[0];\n        String referenceArtifactId = parts[1];\n        String referenceVersion = parts[2];\n\n        getLog().debug(\"Checking alignment with \" + referenceArtifact);\n\n        RepositorySystemSession repositorySession = session.getRepositorySession();\n\n        // Get remote repositories directly from the project (no need for property evaluation)\n        var remoteRepositories = project.getRemoteArtifactRepositories();\n\n        // Get project's dependency versions\n        Map<String, String> projectDependencyVersions = getProjectDependencyVersions(project);\n\n        // Resolve the reference artifact\n        Map<String, String> referenceDependencyVersions = resolveReferenceArtifact(","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/enforcer-rules/src/main/java/io/quarkus/enforcer/DependencyAlignmentRule.java#L59-L95","documentation":"DependencyAlignmentRule parses referenceArtifact by splitting on ':' and requires exactly three parts: groupId, artifactId, version. If the configured value does not have exactly three colon-separated segments, execute() throws EnforcerRuleException showing the invalid value.","triggerScenarios":"referenceArtifact set to a malformed string: only 'group:artifact' (version omitted), 'group:artifact:version:classifier' (extra segments), a bare artifact name, or a GAV using a different separator.","commonSituations":"Typing a BOM coordinates shorthand like 'org.hibernate.orm:hibernate-platform' without a version; pasting a full Maven coordinate with packaging/classifier; using an unresolved property inside the value.","solutions":["Set referenceArtifact to exactly 'groupId:artifactId:version', e.g. org.hibernate.orm:hibernate-platform:7.3.0.Final","Remove any extra ':packaging' or ':classifier' segments","Verify property placeholders resolve to a three-part GAV (mvn help:effective-pom)"],"exampleFix":"// before\n<referenceArtifact>org.hibernate.orm:hibernate-platform</referenceArtifact>\n// after\n<referenceArtifact>org.hibernate.orm:hibernate-platform:7.3.0.Final</referenceArtifact>","handlingStrategy":"validation","validationCode":"// Shell: validate the GAV shape before configuring\necho \"$GA\" | grep -qE '^[^:]+:[^:]+:[^:]+$' && echo ok || echo \"must be group:artifact:version\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always specify all three segments g:a:v; no packaging/classifier suffixes","Validate property values with a quick grep before wiring them into enforcer config","Use the exact example from the error message as a template"],"tags":["maven","enforcer","configuration","validation"],"backgroundTag":"missing-required-config","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"}