quarkusio/quarkus · error · MojoExecutionException
Maven version can't be empty.
Error message
Maven version can't be empty.
What it means
The enforce method throws this MojoExecutionException when the required Maven version range read from quarkus.properties is blank (null/empty/whitespace). The enforcer cannot evaluate a compatibility rule with no range, so it aborts the build immediately. Normally this indicates the quarkus.properties resource is malformed rather than a user configuration problem.
Source
Thrown at devtools/maven/src/main/java/io/quarkus/maven/components/MavenVersionEnforcer.java:66
throw new IOException("Failed to load " + resource + " from the classpath", e);
}
return props;
}
}
/**
* Compares the specified Maven version to see if it is allowed by the defined version range.
*
* @param log the log
* @param requiredMavenVersionRange range of allowed versions for Maven.
* @param actualMavenVersion the version to be checked.
* @throws MojoExecutionException the given version fails the enforcement rule
*/
private void enforce(Log log,
String requiredMavenVersionRange, ArtifactVersion actualMavenVersion)
throws MojoExecutionException {
if (StringUtils.isBlank(requiredMavenVersionRange)) {
throw new MojoExecutionException("Maven version can't be empty.");
}
if (!actualMavenVersion.toString().equals(requiredMavenVersionRange)) {
try {
final VersionRange vr = VersionRange.createFromVersionSpec(requiredMavenVersionRange);
if (!containsVersion(vr, actualMavenVersion)) {
throw new MojoExecutionException(getDetectedVersionStr(actualMavenVersion.toString())
+ " is not supported, it must be in " + vr + ".");
}
} catch (InvalidVersionSpecificationException e) {
throw new MojoExecutionException("The requested Maven version "
+ requiredMavenVersionRange + " is invalid.", e);
}
}
if (log.isDebugEnabled()) {
log.debug(
getDetectedVersionStr(actualMavenVersion.toString()) + " is allowed in " + requiredMavenVersionRange + ".");
}
}View on GitHub (pinned to e1c734241f)
Solutions
- Restore the original quarkus.properties (re-download quarkus-maven-plugin: rm -rf ~/.m2/repository/io/quarkus/quarkus-maven-plugin && ./mvnw -U)
- Inspect the jar's quarkus.properties and ensure the required Maven version range key has a value like [3.6.2,)
- If using a locally built Quarkus, rebuild the devtools/maven module so the resource is regenerated
- File/fix the issue upstream if a Quarkus release shipped a blank range value
Example fix
// before (quarkus.properties inside plugin jar) maven.version.range= // after maven.version.range=[3.6.2,)
Defensive patterns
Strategy: validation
Validate before calling
Properties p = new Properties();
try (var is = Thread.currentThread().getContextClassLoader()
.getResourceAsStream("quarkus.properties")) {
p.load(is);
}
String range = p.getProperty("maven.version.range");
if (range == null || range.isBlank())
throw new IllegalStateException("blank maven.version.range; restore original quarkus.properties"); Prevention
- Never edit resources inside published jars
- Rebuild devtools/maven locally when patching Quarkus
- Validate custom builds by inspecting quarkus.properties
- Report upstream if a release ships a blank range
When it happens
Trigger: ensureMavenVersion → enforce is called with requiredMavenVersionRange blank — i.e. the 'maven.version.range' (required-range) property in quarkus.properties is missing, empty, or whitespace-only.
Common situations: A hand-edited or corrupted quarkus.properties inside the plugin jar; a custom/patched Quarkus build that dropped the property; parsing produced an empty value for the version-range key.
Related errors
- Parameter 'mode' was set to '<mode>' while expected one of '
- Unrecognized dependency flag '<trimmed>'. Supported flags: O
- Parameter 'mode' was set to '<mode>' while expected one of '
- Parameter 'mode' was set to '<mode>' while expected one of '
- Top-level project base directory <dir> specified with system
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/3d974b29aef9b881.
Report an issue: GitHub.