{"record":{"id":"1b30bc109f901911","repo":"quarkusio/quarkus","slug":"artifactcoordssegmentpattern-of-expects-groupid","errorCode":null,"errorMessage":"ArtifactCoordsSegmentPattern.of() expects groupId:artifactId:version or groupId:artifactId:classifier:type:version; found: ${wildcardPattern}","messagePattern":"ArtifactCoordsSegmentPattern\\.of\\(\\) expects groupId:artifactId:version or groupId:artifactId:classifier:type:version; found: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/ArtifactCoordsPattern.java","lineNumber":282,"sourceCode":"        var artifactIdPattern = ArtifactCoordsSegmentPattern.MATCH_ALL;\n        var typePattern = ArtifactCoordsSegmentPattern.MATCH_ALL;\n        var classifierPattern = ArtifactCoordsSegmentPattern.MATCH_ALL;\n        var versionPattern = ArtifactCoordsSegmentPattern.MATCH_ALL;\n        var parts = wildcardPattern.split(DELIMITER_STRING);\n        if (parts.length > 0) {\n            groupIdPattern = new ArtifactCoordsSegmentPattern(parts[0]);\n            if (parts.length > 1) {\n                artifactIdPattern = new ArtifactCoordsSegmentPattern(parts[1]);\n                if (parts.length > 2) {\n                    final String third = parts[2];\n                    if (parts.length > 3) {\n                        final String fourth = parts[3];\n                        if (parts.length > 4) {\n                            classifierPattern = new ArtifactCoordsSegmentPattern(third);\n                            typePattern = new ArtifactCoordsSegmentPattern(fourth);\n                            versionPattern = new ArtifactCoordsSegmentPattern(parts[4]);\n                        } else {\n                            throw new IllegalStateException(\n                                    ArtifactCoordsSegmentPattern.class.getName()\n                                            + \".of() expects groupId:artifactId:version or groupId:artifactId:classifier:type:version; found: \"\n                                            + wildcardPattern);\n                        }\n                    } else {\n                        versionPattern = new ArtifactCoordsSegmentPattern(third);\n                    }\n                }\n            }\n        }\n        return new ArtifactCoordsPattern(groupIdPattern, artifactIdPattern, classifierPattern, typePattern, versionPattern);\n    }\n\n    final ArtifactCoordsSegmentPattern groupIdPattern;\n    final ArtifactCoordsSegmentPattern artifactIdPattern;\n    final ArtifactCoordsSegmentPattern classifierPattern;\n    final ArtifactCoordsSegmentPattern typePattern;\n    final ArtifactCoordsSegmentPattern versionPattern;","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/ArtifactCoordsPattern.java#L264-L300","documentation":"ArtifactCoordsPattern.of accepts only 3-segment (groupId:artifactId:version) or 5-segment (groupId:artifactId:classifier:type:version) patterns. When a pattern has 4 segments and the 4th segment is followed by nothing usable (parts.length <= 4 after the classifier branch), it throws IllegalStateException explaining the accepted formats.","triggerScenarios":"Calling ArtifactCoordsPattern.of/wildcardOf with a 4-segment pattern such as \"com.acme:app:*:*\" or \"group:*:1.0:jar\" — a shape that is neither 3 nor 5 segments.","commonSituations":"Writing dependency include/exclude patterns in Quarkus config where users habitually write 4-segment Maven coords (G:A:C:V) or (G:A:type:V); migrating regex patterns between tools with different accepted segment counts.","solutions":["Use exactly 3 segments (groupId:artifactId:version) or 5 segments (groupId:artifactId:classifier:type:version), using '*' wildcards as needed","Convert 4-segment patterns to 5-segment by inserting an explicit classifier or type segment (e.g. G:A:*:jar:*)","Pre-validate the segment count (2 or 4 ':' separators) before calling of()"],"exampleFix":"// before\nArtifactCoordsPattern p = ArtifactCoordsPattern.of(\"com.acme:app:*:*\"); // throws\n// after\nArtifactCoordsPattern p = ArtifactCoordsPattern.of(\"com.acme:app:*:*:*\");","handlingStrategy":"validation","validationCode":"boolean isValidPattern(String p) {\n    int segs = p.split(\":\", -1).length;\n    return segs == 3 || segs == 5;\n}","typeGuard":null,"tryCatchPattern":"try {\n    ArtifactCoordsPattern.of(pattern);\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"expects groupId:artifactId:version\")) {\n        throw new IllegalArgumentException(\"Use 3 or 5 colon-separated segments: \" + pattern);\n    }\n}","preventionTips":["Write include/exclude patterns as G:A:V or G:A:classifier:type:V only","Convert 4-segment habits (G:A:C:V) to 5 segments by adding a type placeholder","Use '*' for segments you want to match freely","Unit-test your pattern strings against ArtifactCoordsSegmentPattern.of early"],"tags":["pattern-matching","maven-coordinates","wildcard","format-validation"],"backgroundTag":"invalid-coordinate-format","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"}