{"record":{"id":"c73fcf0c8eb474d2","repo":"apache/maven","slug":"ignored-invalid-goal-specification-from-lifec","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/internal/impl/DefaultPackagingRegistry.java","lineNumber":131,"sourceCode":"\n                // Compute goal coordinates\n                String groupId, artifactId, version, goal;\n                String[] p = mojo.getGoal().trim().split(\":\");\n                if (p.length == 3) {\n                    // <groupId>:<artifactId>:<goal>\n                    groupId = p[0];\n                    artifactId = p[1];\n                    version = null;\n                    goal = p[2];\n                } else if (p.length == 4) {\n                    // <groupId>:<artifactId>:<version>:<goal>\n                    groupId = p[0];\n                    artifactId = p[1];\n                    version = p[2];\n                    goal = p[3];\n                } else {\n                    // invalid\n                    LOGGER.warn(\n                            \"Ignored invalid goal specification '{}' from lifecycle mapping for phase {}\",\n                            mojo.getGoal(),\n                            phase);\n                    continue;\n                }\n\n                String key = groupId + \":\" + artifactId;\n\n                // Build plugin\n                List<PluginExecution> execs = new ArrayList<>();\n                List<Dependency> deps = new ArrayList<>();\n\n                Plugin existing = plugins.get(key);\n                if (existing != null) {\n                    if (version == null) {\n                        version = existing.getVersion();\n                    }\n                    execs.addAll(existing.getExecutions());","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultPackagingRegistry.java#L113-L149","documentation":"DefaultPackagingRegistry parses a packaging's lifecycle mapping, where every bound goal must be groupId:artifactId:goal (3 parts) or groupId:artifactId:version:goal (4 parts). A goal string with any other number of colon-separated segments is rejected with this warning and skipped, so that phase in the custom packaging silently runs one fewer goal.","triggerScenarios":"A hand-authored lifecycle mapping for a custom packaging declares goal='prefix:goal' (2 parts), omits a segment, or adds extra segments; the split on ':' does not yield length 3 or 4 and the entry is dropped.","commonSituations":"Custom packaging plugins (own jar/war-like packagings) with typos in lifecycle.xml; mappings migrated from another format where 'groupId:artifactId:version:goal' ordering got mangled.","solutions":["Open the packaging plugin's lifecycle mapping metadata and rewrite the offending goal as groupId:artifactId:goal or groupId:artifactId:version:goal","Rebuild and reinstall the packaging plugin, then re-run the consuming project so the corrected mapping is picked up","Verify with mvn -X (or help:describe on the phase) that the phase now binds the expected goals"],"exampleFix":"<!-- before (custom packaging lifecycle mapping) -->\n<lifecycle>\n  <phases>\n    <phase>my-package</phase>\n  </phases>\n  <mojos>\n    <mojo>my-plugin:do-package</mojo> <!-- 2 parts: ignored -->\n  </mojos>\n</lifecycle>\n<!-- after -->\n<mojo>com.acme:my-plugin:do-package</mojo>\n<!-- or with version pinned: com.acme:my-plugin:1.0:do-package -->","handlingStrategy":"validation","validationCode":"// unit-test your packaging plugin's lifecycle mapping format\nfor (String goal : mappingGoals) {\n    String[] p = goal.split(\":\");\n    if (p.length != 3 && p.length != 4) {\n        throw new IllegalArgumentException(\"Invalid goal spec (must be g:a[:v]:goal): \" + goal);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate lifecycle-mapping goal specs in the packaging plugin's own test suite","Copy goal-spec syntax from current Maven packaging plugins, not old wiki pages","After editing a mapping, reinstall the plugin and clear consumer builds' caches"],"tags":["packaging","lifecycle-mapping","custom-lifecycle","plugin-metadata"],"backgroundTag":"lifecycle-mapping-misconfigured","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}