quarkusio/quarkus · error · IllegalArgumentException
Failed to locate '${c}' in '${s}'
Error message
Failed to locate '${c}' in '${s}' What it means
PlatformImportsImpl.requiredIndex() parses encoded platform property names that embed the platform key, stream, and version using '$' and '#' separators (e.g. for platform release info properties). If the expected separator character is not found from the given index, it throws an IllegalArgumentException. The property name therefore does not follow Quarkus' internal platform property naming convention.
Source
Thrown at independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/model/PlatformImportsImpl.java:32
import java.util.Map;
import java.util.Properties;
import io.quarkus.bootstrap.BootstrapConstants;
import io.quarkus.bootstrap.resolver.AppModelResolverException;
import io.quarkus.maven.dependency.ArtifactCoords;
public class PlatformImportsImpl implements PlatformImports, Serializable {
private static final long serialVersionUID = -1722573527738064746L;
public static final String PROPERTY_PREFIX = "platform.release-info@";
public static final char PLATFORM_KEY_STREAM_SEPARATOR = '$';
public static final char STREAM_VERSION_SEPARATOR = '#';
private static int requiredIndex(String s, char c, int fromIndex) {
final int i = s.indexOf(c, fromIndex);
if (i < 0) {
throw new IllegalArgumentException("Failed to locate '" + c + "' in '" + s + "'");
}
return i;
}
public static boolean isPlatformReleaseInfo(String s) {
return s != null && s.startsWith(PROPERTY_PREFIX);
}
// metadata for each found platform release by platform key
private final Map<String, PlatformInfo> allPlatformInfo = new HashMap<>();
// imported platform BOMs by platform keys (groupId)
private final Map<String, Collection<ArtifactCoords>> importedPlatformBoms = new HashMap<>();
private final Map<ArtifactCoords, PlatformImport> platformImports = new HashMap<>();
private final Map<String, String> collectedProps;
private final Collection<ArtifactCoords> platformBoms;
private final Collection<PlatformReleaseInfo> platformReleaseInfo;View on GitHub (pinned to e1c734241f)
Solutions
- Ensure the platform property name uses the canonical format with '$' between key and stream and '#' between stream and version
- Check where the property came from (BOM properties file) and fix its key spelling
- Use Quarkus' own property generation (codestart / platform tooling) instead of hand-writing these keys
Example fix
// before
props.setProperty("io.quarkus.platform.version", "3.2.0.Final");
// after
props.setProperty("io.quarkus.platform.my-platform$3.2#999-SNAPSHOT.version", "3.2.0.Final"); Defensive patterns
Strategy: validation
Validate before calling
boolean isWellFormedPlatformProperty(String name) {
return name != null && name.indexOf('$') >= 0 && name.indexOf('#') > name.indexOf('$');
}
// run before addPlatformRelease Type guard
boolean containsSeparators(String s) { return s != null && s.indexOf('$') >= 0 && s.indexOf('#') >= 0; } Try / catch
try {
imports.addPlatformRelease(name, value);
} catch (IllegalArgumentException e) {
log.errorf("Malformed platform property '%s': %s", name, e.getMessage());
} Prevention
- Generate platform property keys with Quarkus tooling, not by hand
- Keep the 'key$stream#version' separator convention intact when renaming keys
- Only feed properties whose names start with the platform property prefix into these APIs
When it happens
Trigger: Passing a property name to addPlatformRelease/platform-key parsing that lacks the '$' (PLATFORM_KEY_STREAM_SEPARATOR) or '#' (STREAM_VERSION_SEPARATOR) character where required.
Common situations: Hand-crafted or renamed quarkus.platform.* properties in a BOM-derived properties file; importing a properties file whose platform property keys don't use the canonical 'key$stream#version' encoding; version changes where the property naming convention changed.
Related errors
- Unexpected end of input: ${str}
- Unexpected character '${str.charAt(pos)}' at position ${pos}
- unbalanced quotes in
- invalid config ${comment}
- Could not parse HTML entity &${abbrev}; in ${text}
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/d63ab2a690e26556.
Report an issue: GitHub.