{"record":{"id":"44ed327227be2557","repo":"quarkusio/quarkus","slug":"quarkus-native-image-agent-filter-generation-phase","errorCode":null,"errorMessage":"Quarkus native image agent filter generation phase has failed","messagePattern":"Quarkus native image agent filter generation phase has failed","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/GenerateCodeTestsMojo.java","lineNumber":112,"sourceCode":"                .forEach(rules::add);\n        result.put(\"rules\", rules);\n\n        final Json.JsonArrayBuilder regexRules = Json.array();\n        regexRules.add(Json.object().put(\"excludeClasses\", \".*_Bean\"));\n        result.put(\"regexRules\", regexRules);\n\n        try (BufferedWriter writer = new BufferedWriter(new FileWriter(path.toFile(), StandardCharsets.UTF_8))) {\n            result.appendTo(writer);\n        } catch (IOException e) {\n            throw new MojoExecutionException(\"Unable to write quarkus native image agent caller filter to \" + path, e);\n        }\n    }\n\n    private Collection<ResolvedDependency> getDependencies() throws MojoExecutionException {\n        try (CuratedApplication curatedApplication = bootstrapApplication(LaunchMode.TEST)) {\n            return curatedApplication.getApplicationModel().getDependencies();\n        } catch (Exception any) {\n            throw new MojoExecutionException(\"Quarkus native image agent filter generation phase has failed\", any);\n        }\n    }\n\n    private Set<String> getCommonExcludePackageNames() {\n        Set<String> packageNames = new HashSet<>();\n        // Any calls that access or originate in these packages\n        // that require native configuration should be handled by Quarkus.\n        packageNames.add(\"io.netty\");\n        packageNames.add(\"io.quarkus\");\n        packageNames.add(\"io.smallrye\");\n        packageNames.add(\"io.vertx\");\n        packageNames.add(\"jakarta\");\n        packageNames.add(\"org.jboss\");\n        return packageNames;\n    }\n}\n","sourceCodeStart":94,"sourceCodeEnd":129,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/GenerateCodeTestsMojo.java#L94-L129","documentation":"GenerateCodeTestsMojo.getDependencies bootstraps the application in TEST launch mode to collect the application model's dependencies for native agent filter generation. Any exception during bootstrap or model retrieval is wrapped in this MojoExecutionException. The underlying cause (dependency resolution, curation, config) is in the `Caused by` chain.","triggerScenarios":"bootstrapApplication(LaunchMode.TEST) or getApplicationModel().getDependencies() throws — e.g. unresolvable test-scoped dependencies, application curation errors, or invalid Quarkus configuration in test scope.","commonSituations":"Missing or conflicting test dependencies; platform/version misalignment; corrupted local repo preventing dependency resolution; quarkus.* config errors that fail application curation during `mvn quarkus:generate-code-tests`.","solutions":["Run with -e and inspect the `Caused by` for the root bootstrap failure","Fix dependency resolution issues (`mvn dependency:resolve -U`)","Align Quarkus extension versions with the platform BOM","Validate quarkus.* test configuration properties"],"exampleFix":"mvn quarkus:generate-code-tests -e  # read the Caused-by chain","handlingStrategy":"try-catch","validationCode":"mvn dependency:resolve -U && mvn test-compile  # confirm test-scope deps resolve and compile first","typeGuard":null,"tryCatchPattern":"try {\n    mvn quarkus:generate-code-tests\n} catch (MojoExecutionException e) {\n    Throwable root = e; while (root.getCause() != null) root = root.getCause();\n    // fix dependency/config issue reported by root\n}","preventionTips":["Keep test dependencies resolvable and version-aligned with the platform","Run `mvn dependency:resolve -U` after repo or version changes","Validate test-scope quarkus.* configuration"],"tags":["maven","dependency-resolution","native-image","test"],"backgroundTag":"dependency-resolution-failed","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"}