{"record":{"id":"12bbfe9f18c5c84b","repo":"quarkusio/quarkus","slug":"referenceartifact-must-be-configured-e-g-org-h","errorCode":null,"errorMessage":"referenceArtifact must be configured (e.g., 'org.hibernate.orm:hibernate-platform:7.3.0.Final')","messagePattern":"referenceArtifact must be configured \\(e\\.g\\., 'org\\.hibernate\\.orm:hibernate-platform:7\\.3\\.0\\.Final'\\)","errorType":"validation","errorClass":"EnforcerRuleException","httpStatus":null,"severity":"error","filePath":"independent-projects/enforcer-rules/src/main/java/io/quarkus/enforcer/DependencyAlignmentRule.java","lineNumber":66,"sourceCode":"    @Inject\n    private MavenSession session;\n\n    @Inject\n    private RepositorySystem repositorySystem;\n\n    public void setReferenceArtifact(String referenceArtifact) {\n        this.referenceArtifact = referenceArtifact;\n    }\n\n    public void setDependencies(List<DependencyAlignmentData> dependencies) {\n        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);","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/enforcer-rules/src/main/java/io/quarkus/enforcer/DependencyAlignmentRule.java#L48-L84","documentation":"DependencyAlignmentRule is a Maven enforcer rule that verifies versions of a set of artifacts against a single reference BOM/platform artifact. Before doing any work it validates its configuration; if the referenceArtifact string (the 'groupId:artifactId:version' to align against) is missing or blank, execute() throws EnforcerRuleException immediately.","triggerScenarios":"Executing the rule (mvn enforcer:enforce on a pom where DependencyAlignmentRule is bound) with <referenceArtifact> omitted, set to empty string, or set to whitespace only in the rule configuration.","commonSituations":"Copy-pasting the rule into a pom without filling in referenceArtifact; property placeholders like ${hibernate.platform.version} resolving to empty because the property is undefined; accidental XML comment removal.","solutions":["Configure <referenceArtifact> in the rule's <configuration>, e.g. org.hibernate.orm:hibernate-platform:7.3.0.Final","If using a property placeholder, verify it is defined and non-empty in the effective pom (mvn help:effective-pom)","Ensure enforcer configuration is inside the correct <rules><dependencyAlignment> element, not misplaced"],"exampleFix":"// before\n<referenceArtifact></referenceArtifact>\n// after\n<referenceArtifact>org.hibernate.orm:hibernate-platform:7.3.0.Final</referenceArtifact>","handlingStrategy":"validation","validationCode":"<!-- Shell pre-check -->\nmvn help:effective-pom | grep -A1 referenceArtifact\n# Ensure a non-empty three-part GAV is configured","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never add DependencyAlignmentRule without referenceArtifact; copy a working configuration from an existing pom","Use a property like ${hibernate.platform.version} and verify it is defined in the same pom or parent","Run mvn help:effective-pom to confirm placeholders resolve"],"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-14T00:17:10.932Z"}