{"record":{"id":"a6c4e87ab1635429","repo":"apache/maven","slug":"ignored-invalid-goal-specification-from-lifec-a6c4e8","errorCode":null,"errorMessage":"Ignored invalid goal specification '{}' from lifecycle mapping for phase {}","messagePattern":"Ignored invalid goal specification '(.+?)' from lifecycle mapping for phase (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java","lineNumber":144,"sourceCode":"        return lookup.lookupOptional(LifecycleMapping.class, packaging).orElse(null);\n    }\n\n    private void parseLifecyclePhaseDefinitions(Map<Plugin, Plugin> plugins, String phase, LifecyclePhase goals) {\n        InputSource inputSource = new InputSource();\n        inputSource.setModelId(DefaultLifecycleRegistry.DEFAULT_LIFECYCLE_MODELID);\n        InputLocation location = new InputLocation(-1, -1, inputSource);\n        location.setLocation(0, location);\n\n        List<LifecycleMojo> mojos = goals.getMojos();\n        if (mojos != null) {\n\n            for (int i = 0; i < mojos.size(); i++) {\n                LifecycleMojo mojo = mojos.get(i);\n\n                GoalSpec gs = parseGoalSpec(mojo.getGoal());\n\n                if (gs == null) {\n                    logger.warn(\n                            \"Ignored invalid goal specification '{}' from lifecycle mapping for phase {}\",\n                            mojo.getGoal(),\n                            phase);\n                    continue;\n                }\n\n                Plugin plugin = new Plugin();\n                plugin.setGroupId(gs.groupId);\n                plugin.setArtifactId(gs.artifactId);\n                plugin.setVersion(gs.version);\n\n                plugin.setLocation(\"\", location);\n                plugin.setLocation(\"groupId\", location);\n                plugin.setLocation(\"artifactId\", location);\n                plugin.setLocation(\"version\", location);\n\n                Plugin existing = plugins.get(plugin);\n                if (existing != null) {","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java#L126-L162","documentation":"DefaultLifecyclePluginAnalyzer converts a packaging's lifecycle mapping into plugin executions for the 'clean-less' default lifecycle analysis. parseGoalSpec returns null for any goal string that is not exactly groupId:artifactId:goal or groupId:artifactId:version:goal; such entries are skipped with this warning, leaving the phase without that execution.","triggerScenarios":"The <lifecycle> metadata of a custom packaging (its LifecycleMojo list) contains a malformed goal string - wrong segment count, empty segments, or a stray prefix - when Maven derives the default lifecycle plugin bindings for the packaging.","commonSituations":"Hand-written packaging descriptors; copy-paste from documentation examples that omit the groupId; mappings edited directly inside the built plugin jar.","solutions":["Fix the goal specification in the packaging plugin's lifecycle mapping to groupId:artifactId[:version]:goal","Reinstall the packaging plugin and re-run so the corrected mapping is re-analyzed","Confirm the phase executes the expected goals afterwards (mvn -X shows the derived plugin executions)"],"exampleFix":"# lifecycle mapping goal specs\n# before\nmy-plugin:my-goal                 # invalid: 2 segments\ncom.acme:my-plugin:1.0:my-goal:extra  # invalid: 5 segments\n# after\ncom.acme:my-plugin:my-goal        # 3 segments: ok\ncom.acme:my-plugin:1.0:my-goal    # 4 segments: ok","handlingStrategy":"validation","validationCode":"// guard in DefaultLifecyclePluginAnalyzer-style flows: reject bad specs before analysis\nstatic boolean isValidGoalSpec(String goal) {\n    String[] p = goal.split(\":\");\n    return (p.length == 3 || p.length == 4) && Arrays.stream(p).noneMatch(String::isEmpty);\n}\n\nif (!isValidGoalSpec(mojo.getGoal())) failFast(mojo.getGoal());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Parse-test lifecycle mapping metadata in the packaging plugin's build","Keep goal specs as g:a:goal or g:a:v:goal exactly - no prefixes, no empty segments"],"tags":["lifecycle-mapping","packaging","goal-specification","plugin-metadata"],"backgroundTag":"lifecycle-mapping-misconfigured","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}