{"record":{"id":"762980391f1d4a1f","repo":"apache/maven","slug":"could-not-find-goal-goal-in-plugin-pluginde","errorCode":null,"errorMessage":"Could not find goal '${goal}' in plugin ${pluginDescriptor.getId()} among available goals ${availableGoals}","messagePattern":"Could not find goal '(.+?)' in plugin (.+?) among available goals (.+?)","errorType":"exception","errorClass":"MojoNotFoundException","httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java","lineNumber":299,"sourceCode":"            throws PluginDescriptorParsingException {\n        try {\n            return builder.build(is, descriptorLocation);\n        } catch (PlexusConfigurationException e) {\n            throw new PluginDescriptorParsingException(plugin, descriptorLocation, e);\n        }\n    }\n\n    @Override\n    public MojoDescriptor getMojoDescriptor(\n            Plugin plugin, String goal, List<RemoteRepository> repositories, RepositorySystemSession session)\n            throws MojoNotFoundException, PluginResolutionException, PluginDescriptorParsingException,\n                    InvalidPluginDescriptorException {\n        PluginDescriptor pluginDescriptor = getPluginDescriptor(plugin, repositories, session);\n\n        MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo(goal);\n\n        if (mojoDescriptor == null) {\n            throw new MojoNotFoundException(goal, pluginDescriptor);\n        }\n\n        return mojoDescriptor;\n    }\n\n    @Override\n    public void checkPrerequisites(PluginDescriptor pluginDescriptor) throws PluginIncompatibleException {\n        List<IllegalStateException> prerequisiteExceptions = new ArrayList<>();\n        prerequisitesCheckers.forEach(c -> {\n            try {\n                c.accept(pluginDescriptor);\n            } catch (IllegalStateException e) {\n                prerequisiteExceptions.add(e);\n            }\n        });\n        // aggregate all exceptions\n        if (!prerequisiteExceptions.isEmpty()) {\n            String messages = prerequisiteExceptions.stream()","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java#L281-L317","documentation":"getMojoDescriptor() looked up the requested goal name in the plugin's parsed descriptor and found no matching MojoDescriptor, so MojoNotFoundException reports the goal, the plugin id and the goals the descriptor actually offers. Goal names are matched exactly and case-sensitively.","triggerScenarios":"A typo'd goal on the CLI or in an <execution>; a plugin version - pinned explicitly or defaulted via prefix resolution - from a release where the goal was renamed, removed, or not yet introduced; a plugin prefix mapping to a different artifact than expected.","commonSituations":"CLI typos like mvn dependenc:analyze; prefix resolution defaulting to an old version without a newer goal; copied <execution> blocks referencing goals of a newer plugin version than the pinned one.","solutions":["Copy the exact goal name from the error's 'among available goals' list and rerun.","List all goals with details: mvn <groupId>:<artifactId>:<version>:help -Ddetail.","Pin the plugin version in <pluginManagement> whose release actually contains the goal.","Check spelling and capitalization of the goal name."],"exampleFix":"// before\nmvn dependenc:analyze\n// after\nmvn dependency:analyze","handlingStrategy":"validation","validationCode":"mvn <groupId>:<artifactId>:<version>:help -Ddetail 2>&1 | grep ':<goalName>' \\\n  || echo 'goal does not exist in this plugin version'","typeGuard":null,"tryCatchPattern":"try {\n    mojoDescriptor = pluginManager.getMojoDescriptor(plugin, goal, repositories, session.getRepositorySession());\n} catch (MojoNotFoundException e) {\n    throw new IllegalArgumentException(\"unknown goal '\" + goal + \"' - run \" + plugin.getId() + \":help -Ddetail\");\n}","preventionTips":["Pin plugin versions explicitly instead of relying on prefix resolution defaults","Diff goal lists via g:a:v:help -Ddetail whenever upgrading plugins","Quote goal names in CI scripts to catch shell munging"],"tags":["maven","goal","mojo-not-found","typo","version-mismatch"],"backgroundTag":"maven-goal-not-found","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}