quarkusio/quarkus · error · MojoFailureException
Failed to run
Error message
Failed to run
What it means
DevMojo.execute wraps the entire dev-mode lifecycle (starting the runner, restarting on file changes, terminal handling) in a try block and converts any Exception into MojoFailureException 'Failed to run' with the original cause attached. It is a generic wrapper; the real cause is the chained exception printed below it.
Source
Thrown at devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java:594
// stop the runner before we build the new one as the debug port being free
// is tested when building the runner
runner.stop();
final DevModeRunner newRunner;
try {
bootstrapId = handleAutoCompile(changedPoms);
newRunner = new DevModeRunner(runner.commandLine.getDebugPort(), bootstrapId, pomFiles.keySet());
} catch (Exception e) {
getLog().info("Could not load changedPoms pom.xml file, changes not applied", e);
continue;
}
newRunner.run();
runner = newRunner;
}
}
}
} catch (Exception e) {
throw new MojoFailureException("Failed to run", e);
}
}
private List<String> collectChangeFilesFrom(Map<Path, Long> paths) throws IOException {
// unless it's a git or some other command, there won't be many files modified in 100 milliseconds
List<String> changedFiles = new ArrayList<>(1);
for (Map.Entry<Path, Long> e : paths.entrySet()) {
long t = Files.getLastModifiedTime(e.getKey()).toMillis();
if (t > e.getValue()) {
changedFiles.add(e.getKey().toString());
paths.put(e.getKey(), t);
}
}
return changedFiles;
}
private void logChanges(List<String> changedFiles) {
final StringBuilder sb = new StringBuilder().append("Restarting dev mode following changes in ");View on GitHub (pinned to e1c734241f)
Solutions
- Read the 'Caused by:' section of the stack trace — it holds the actual failure.
- Fix the underlying cause (config error, compilation failure, missing dependency) rather than this wrapper.
- Clean and rebuild (mvn clean install -DskipTests) if state from a previous run is corrupt.
- Update the Quarkus Maven plugin and Quarkus versions to matching, recent releases if the crash is a plugin bug.
Example fix
// diagnose mvn quarkus:dev -e # inspect 'Caused by:' // common fix clean broken target state mvn clean install -DskipTests && mvn quarkus:dev
Defensive patterns
Strategy: try-catch
Validate before calling
// verify a clean build state first mvn clean install -DskipTests
Try / catch
try {
runDevMode();
} catch (MojoFailureException e) {
// this message is generic; always surface the root cause
Throwable root = e;
while (root.getCause() != null) root = root.getCause();
log.error("Dev mode failed: " + root.getMessage(), root);
} Prevention
- Always diagnose the chained 'Caused by' — this wrapper hides the real error.
- Clean target/ when dev-mode state looks corrupt.
- Keep the Quarkus plugin and platform versions aligned.
- Run with -e for full stack traces.
When it happens
Trigger: Any exception thrown while running or restarting the dev-mode runner: failure to launch the JVM, errors during hot-reload handling, IO problems watching files, or the MojoExecutionException from a failed dev process propagating up.
Common situations: Application crash during dev session (see root cause); file watcher failures on network drives; exception during runner restart after a POM change; JDK incompatibility when spawning the dev process.
Related errors
- Dev mode process did not complete successfully
- Failed to obtain descriptor for Maven plugin <pluginId> goal
- Local dependency <module> does not appear to have any source
- Hot reloadable dependency <moduleId> has not been compiled y
- Top-level project base directory <dir> specified with system
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/5d8184a58034daad.
Report an issue: GitHub.