{"record":{"id":"bad134fe52065e49","repo":"quarkusio/quarkus","slug":"failed-to-apply-the-updates","errorCode":null,"errorMessage":"Failed to apply the updates","messagePattern":"Failed to apply the updates","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/UpdateMojo.java","lineNumber":156,"sourceCode":"        // backward compat\n        if (noRewrite != null && noRewrite) {\n            rewrite = false;\n        }\n\n        if (rewrite != null) {\n            invoker.rewrite(rewrite);\n        }\n\n        try {\n            final QuarkusCommandOutcome result = invoker.execute();\n            if (!result.isSuccess()) {\n                throw new MojoExecutionException(\n                        \"Failed to apply the updates: \" + result.getMessage());\n            }\n        } catch (QuarkusUpdateExitErrorException e) {\n            throw new MojoExecutionException(e.getMessage());\n        } catch (QuarkusCommandException e) {\n            throw new MojoExecutionException(\"Failed to apply the updates\", e);\n        }\n    }\n\n    private static ArtifactCoords getPrimaryBom(ExtensionCatalog c) {\n        return c.getDerivedFrom().isEmpty() ? c.getBom() : c.getDerivedFrom().get(0).getBom();\n    }\n}\n","sourceCodeStart":138,"sourceCodeEnd":164,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/UpdateMojo.java#L138-L164","documentation":"The final catch in UpdateMojo.processProjectState wraps any QuarkusCommandException from invoker.execute() as MojoExecutionException 'Failed to apply the updates' with the original exception attached as cause. This is the generic wrapper: the update command itself threw an unexpected exception rather than returning a failed outcome.","triggerScenarios":"QuarkusCommandException thrown by UpdateProject.execute(): internal command errors such as IO problems rewriting build files, model resolution failures mid-rewrite, or command framework errors — anything that surfaces as QuarkusCommandException instead of a clean isSuccess()==false outcome.","commonSituations":"Filesystem permission problems while rewriting pom.xml/build.gradle; malformed build files that parse initially but fail on rewrite; transient IO errors; bugs in update recipes for exotic project layouts.","solutions":["Inspect the cause chain of this MojoExecutionException for the underlying QuarkusCommandException","Check that build files (pom.xml / build.gradle) are valid, writable, and not locked","Commit or back up the project, then re-run `mvn quarkus:update` on a clean state","As a last resort upgrade manually: bump quarkus.platform.version and follow the migration guide for the target version"],"exampleFix":"// manual fallback\n<!-- before -->\n<quarkus.platform.version>2.16.0.Final</quarkus.platform.version>\n<!-- after -->\n<quarkus.platform.version>3.15.1</quarkus.platform.version>","handlingStrategy":"try-catch","validationCode":"// Ensure build files are valid and writable before updating:\nmvn validate && test -w pom.xml && echo ok","typeGuard":null,"tryCatchPattern":"catch (MojoExecutionException e) {\n  if (\"Failed to apply the updates\".equals(e.getMessage()) && e.getCause() instanceof QuarkusCommandException) {\n    log.error(\"Update command crashed; cause:\", e.getCause());\n  } else throw e;\n}","preventionTips":["Validate and commit build files before running quarkus:update","Keep the project layout conventional (standard pom/gradle structure)","Run on a clean CI-like environment to avoid transient IO issues","Fall back to manual platform-version bumps plus the migration guide for exotic projects"],"tags":["maven","quarkus","upgrade"],"backgroundTag":"update-apply-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}