{"record":{"id":"d8bc76f3421a993c","repo":"quarkusio/quarkus","slug":"missingdeploymentdeps-size-minimal-deployme","errorCode":null,"errorMessage":"${missingDeploymentDeps.size()} minimal *-deployment dependencies are missing/configured incorrectly:\n    ${joined}\n\nTo fix this issue, add the following dependencies to pom.xml:\n\n        <!-- Minimal test dependencies to *-deployment artifacts for consistent build order -->\n${requiredDeps}","messagePattern":"(.+?) minimal \\*-deployment dependencies are missing/configured incorrectly:\n    (.+?)\n\nTo fix this issue, add the following dependencies to pom\\.xml:\n\n        <!-- Minimal test dependencies to \\*-deployment artifacts for consistent build order -->\n(.+?)","errorType":"validation","errorClass":"EnforcerRuleException","httpStatus":null,"severity":"error","filePath":"independent-projects/enforcer-rules/src/main/java/io/quarkus/enforcer/RequiresMinimalDeploymentDependency.java","lineNumber":76,"sourceCode":"\n        List<String> missingDeploymentDeps = nonDeploymentArtifactsByGAV.entrySet().parallelStream()\n                .filter(entry -> directDepsByGAV.containsKey(entry.getKey())) // only direct deps\n                .map(entry -> parseDeploymentGAV(entry.getKey(), entry.getValue()))\n                .sequential()\n                .filter(optDeploymentGAV -> optDeploymentGAV\n                        .map(deploymentGAV -> !isMinDeploymentDepPresent(deploymentGAV, projArtifactKey,\n                                existingUnmatchedDeploymentDeps))\n                        .orElse(false))\n                .map(Optional::get)\n                .sorted()\n                .collect(Collectors.toList());\n\n        if (!missingDeploymentDeps.isEmpty()) {\n            String requiredDeps = missingDeploymentDeps.stream()\n                    .map(gav -> (Object[]) gav.split(\":\"))\n                    .map(gavArray -> String.format(DEP_TEMPLATE, gavArray))\n                    .collect(Collectors.joining(\"\\n\"));\n            throw new EnforcerRuleException(missingDeploymentDeps.size()\n                    + \" minimal *-deployment dependencies are missing/configured incorrectly:\\n\"\n                    + \"    \" + missingDeploymentDeps.stream().collect(Collectors.joining(\"\\n    \"))\n                    + \"\\n\\nTo fix this issue, add the following dependencies to pom.xml:\\n\\n\"\n                    + \"        <!-- Minimal test dependencies to *-deployment artifacts for consistent build order -->\\n\"\n                    + requiredDeps);\n        }\n        if (!existingUnmatchedDeploymentDeps.isEmpty()) {\n            Set<String> nonSuperfluous = parseNonSuperfluosArtifactIdsFromProperty(project);\n            if (!nonSuperfluous.isEmpty()) {\n                existingUnmatchedDeploymentDeps\n                        .removeIf(gav -> nonSuperfluous.stream().anyMatch(aid -> gav.contains(\":\" + aid + \":\")));\n            }\n            if (!existingUnmatchedDeploymentDeps.isEmpty()) {\n                String superfluousDeps = existingUnmatchedDeploymentDeps.stream()\n                        .map(gav -> \"    \" + gav)\n                        .sorted()\n                        .collect(Collectors.joining(\"\\n\"));\n                throw new EnforcerRuleException(existingUnmatchedDeploymentDeps.size()","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/enforcer-rules/src/main/java/io/quarkus/enforcer/RequiresMinimalDeploymentDependency.java#L58-L94","documentation":"This Maven enforcer rule (RequiresMinimalDeploymentDependency) verifies that every module which depends on a Quarkus extension runtime artifact also declares a test-scoped dependency on the corresponding *-deployment artifact, guaranteeing consistent build order. When runtime dependencies lack the matching minimal deployment dependency, execute() throws EnforcerRuleException listing each missing GAV and the exact <dependency> XML to paste.","triggerScenarios":"Running Maven with the enforcer rule enabled on a module whose pom.xml declares dependencies on io.quarkus.* runtime artifacts without matching minimal test dependencies on their *-deployment counterparts, or with the deployment dependency configured with wrong scope/type/optional flags.","commonSituations":"Adding a new Quarkus extension dependency to a pom.xml by hand; adding an internal extension runtime module and forgetting the deployment artifact; copying dependency blocks that omit the deployment test dep; renaming/refactoring modules so the deployment GAV no longer matches.","solutions":["Copy the <dependency> XML snippets printed in the error message into the <dependencies> section of your pom.xml","Ensure each deployment dependency uses the exact scope/type/optional settings expected by the rule (typically test scope)","Re-run the build to verify the enforcer rule passes"],"exampleFix":"<!-- before -->\n<dependency>\n  <groupId>io.quarkus</groupId>\n  <artifactId>quarkus-myext</artifactId>\n</dependency>\n<!-- after -->\n<dependency>\n  <groupId>io.quarkus</groupId>\n  <artifactId>quarkus-myext</artifactId>\n</dependency>\n<!-- Minimal test dependencies to *-deployment artifacts for consistent build order -->\n<dependency>\n  <groupId>io.quarkus</groupId>\n  <artifactId>quarkus-myext-deployment</artifactId>\n  <scope>test</scope>\n  <type>pom</type>\n  <optional>true</optional>\n</dependency>","handlingStrategy":"validation","validationCode":"// Check pom.xml pairs each runtime dep with a minimal test-scope -deployment dep before building\n// mvn enforcer:enforce -Prules; or pre-validate:\nSet<String> runtimeGavs = readDependencies(pom).stream()\n    .filter(d -> d.getGroupId().startsWith(\"io.quarkus\") && !d.getArtifactId().endsWith(\"-deployment\"))\n    .map(d -> d.getGroupId() + \":\" + d.getArtifactId())\n    .collect(toSet());\nSet<String> depGavs = readDependencies(pom).stream().map(d -> d.getGroupId() + \":\" + d.getArtifactId()).collect(toSet());\nruntimeGavs.forEach(r -> assert depGavs.contains(r + \"-deployment\") : \"missing minimal deployment dep: \" + r);","typeGuard":null,"tryCatchPattern":"// EnforcerRuleException fails the build by design; fix pom.xml rather than catching.\ntry {\n  invoker.executeMaven(\"enforcer:enforce\");\n} catch (MavenInvocationException e) {\n  if (e.getMessage().contains(\"minimal *-deployment dependencies are missing\")) { fixPomDependencies(); }\n  throw e;\n}","preventionTips":["Generate new extension poms from the Quarkus archetypes, which include the required deployment deps","Run the enforcer rule locally before pushing; don't rely only on CI","When adding a runtime artifact dependency, immediately add its matching test-scope -deployment dependency","Keep dependency blocks copied as G:A pairs (runtime + deployment) to avoid omissions"],"tags":["maven","enforcer-rule","build-order","dependency-management"],"backgroundTag":"missing-maven-dependency","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"}