quarkusio/quarkus · error · EnforcerRuleException
${existingUnmatchedDeploymentDeps.size()} minimal *-deployme
Error message
${existingUnmatchedDeploymentDeps.size()} minimal *-deployment dependencies are superfluous and must be removed from pom.xml:
${superfluousDeps} What it means
The RequiresMinimalDeploymentDependency enforcer rule also detects the opposite problem: pom.xml declares test dependencies on *-deployment artifacts that are not required by any runtime dependency. execute() throws EnforcerRuleException listing the superfluous GAVs that must be removed to keep dependency graphs minimal and build order consistent.
Source
Thrown at independent-projects/enforcer-rules/src/main/java/io/quarkus/enforcer/RequiresMinimalDeploymentDependency.java:94
throw new EnforcerRuleException(missingDeploymentDeps.size()
+ " minimal *-deployment dependencies are missing/configured incorrectly:\n"
+ " " + missingDeploymentDeps.stream().collect(Collectors.joining("\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"
+ requiredDeps);
}
if (!existingUnmatchedDeploymentDeps.isEmpty()) {
Set<String> nonSuperfluous = parseNonSuperfluosArtifactIdsFromProperty(project);
if (!nonSuperfluous.isEmpty()) {
existingUnmatchedDeploymentDeps
.removeIf(gav -> nonSuperfluous.stream().anyMatch(aid -> gav.contains(":" + aid + ":")));
}
if (!existingUnmatchedDeploymentDeps.isEmpty()) {
String superfluousDeps = existingUnmatchedDeploymentDeps.stream()
.map(gav -> " " + gav)
.sorted()
.collect(Collectors.joining("\n"));
throw new EnforcerRuleException(existingUnmatchedDeploymentDeps.size()
+ " minimal *-deployment dependencies are superfluous and must be removed from pom.xml:\n"
+ superfluousDeps);
}
}
}
private boolean isMinDeploymentDepPresent(String deploymentGAV, String projArtifactKey,
Set<String> existingDeploymentDeps) {
return deploymentGAV.equals(projArtifactKey) // special case: current project itself is the "required dependency"
|| existingDeploymentDeps.remove(deploymentGAV);
}
private Set<String> parseNonSuperfluosArtifactIdsFromProperty(MavenProject project) {
String propValue = project.getProperties().getProperty("enforcer.requiresMinimalDeploymentDependency.nonSuperfluous");
if (propValue != null) {
return Arrays.stream(propValue.split(",")).map(String::trim).collect(Collectors.toSet());
} else {
return Collections.emptySet();View on GitHub (pinned to e1c734241f)
Solutions
- Remove the listed *-deployment dependency entries from pom.xml
- If you intended to keep one, restore the matching runtime dependency so the pair is complete
- Re-run the build to confirm the enforcer rule passes
Example fix
<!-- before --> <dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-oldext-deployment</artifactId> <scope>test</scope> </dependency> <!-- after: remove the stale deployment dependency entirely -->
Defensive patterns
Strategy: validation
Validate before calling
// Audit pom.xml for -deployment deps with no matching runtime dependency
Set<String> gavs = readDependencies(pom).stream().map(d -> d.getGroupId() + ":" + d.getArtifactId()).collect(toSet());
gavs.stream().filter(g -> g.endsWith("-deployment"))
.forEach(g -> { if (!gavs.contains(g.substring(0, g.length() - "-deployment".length())))
System.out.println("superfluous deployment dep: " + g); }); Try / catch
// Rule fails the build intentionally; react to the message instead:
try {
invoker.executeMaven("enforcer:enforce");
} catch (MavenInvocationException e) {
if (e.getMessage().contains("superfluous")) { removeListedDeploymentDeps(); }
throw e;
} Prevention
- When removing a runtime dependency, delete its -deployment test dependency in the same change
- Never hand-add -deployment deps without a runtime counterpart
- Run the enforcer rule locally before committing pom.xml changes
- Search poms for "-deployment" periodically to audit pairing
When it happens
Trigger: Maven build with the enforcer rule active where existingUnmatchedDeploymentDeps is non-empty — i.e. a *-deployment artifact is declared in pom.xml but its corresponding runtime artifact is not a dependency (or was removed/renamed).
Common situations: Removing or renaming a runtime dependency but leaving its -deployment test dep behind; renaming an extension so GAVs no longer pair up; copy-pasting deployment dependencies that are unnecessary for the module.
Related errors
- ${missingDeploymentDeps.size()} minimal *-deployment depende
- ${coords} is missing version and is not found among the depe
- Dependency version alignment check failed: ${errors}
- //project not found in [<pomXmlPath>]
- Unable to determine groupId and artifactId of the jar that c
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/e5b01d7de01e214d.
Report an issue: GitHub.