quarkusio/quarkus · error · IllegalStateException
Failed to locate the repository URL corresponding to reposit
Error message
Failed to locate the repository URL corresponding to repository ${srcRepoId} What it means
After successfully resolving the registry descriptor, buildRegistryClient() tries to determine which remote repository served it by matching result.getRepository().getId() against the resolver's configured repositories to obtain the source URL. If the artifact came from a repository whose id is not present in the resolver's repository list, this IllegalStateException is thrown — an internal consistency failure indicating the resolver configuration and artifact result disagree.
Source
Thrown at independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/client/maven/MavenRegistryClientFactory.java:115
registryDescriptorCoords, cleanupTimestampedArtifacts);
} catch (BootstrapMavenException e) {
throw new RegistryResolutionException(getDescriptorResolutionFailureMessage(config, resolver, e));
}
}
final String srcRepoId = result.getRepository() == null ? "n/a" : result.getRepository().getId();
log.debug("Resolved registry descriptor %s from %s", registryDescriptorCoords, srcRepoId);
if (!registryRepos.isEmpty()) {
if (srcRepoId != null && !"local".equals(srcRepoId)) {
String srcRepoUrl = null;
for (RemoteRepository repo : resolver.getRepositories()) {
if (repo.getId().equals(srcRepoId)) {
srcRepoUrl = repo.getUrl();
break;
}
}
if (srcRepoUrl == null) {
throw new IllegalStateException(
"Failed to locate the repository URL corresponding to repository " + srcRepoId);
}
} else {
log.debug("Failed to determine the remote repository for %s registry descriptor %s", config.getId(),
registryDescriptorCoords);
}
}
final RegistryConfig.Mutable descriptor;
try {
// Do not fix or add any missing bits.
descriptor = RegistryConfig.mutableFromFile(result.getArtifact().getFile().toPath());
} catch (IOException e) {
throw new IllegalStateException("Failed to deserialize registries descriptor " + result.getArtifact().getFile(), e);
}
if (!isComplete(config, descriptor)) {
config = completeRegistryConfig(config, descriptor);View on GitHub (pinned to e1c734241f)
Solutions
- Inspect settings.xml mirrors/profiles and make the effective repository id match the configured registry repo id (align <mirror><id> or remove the renaming mirror)
- Run with -X / debug logging to see which repository id the artifact was actually resolved from and compare with the configured list
- Update the Quarkus registry-client/Maven resolver versions — this can be an internal inconsistency bug fixed upstream
- As a workaround, define the registry repository explicitly (matching id and url) in settings.xml so the id lookup succeeds
Example fix
// before: mirror id differs from the registry repo id <mirror><id>my-corp-mirror</id><mirrorOf>quarkus-registry</mirrorOf>... // after: keep the same id so lookup matches <mirror><id>quarkus-registry</id><url>https://corp-mirror.example/quarkus</url><mirrorOf>quarkus-registry</mirrorOf>...</mirror>
Defensive patterns
Strategy: validation
Validate before calling
// before building the client, ensure repository ids are unique and mirrors keep ids stable
Set<String> ids = new HashSet<>();
for (RemoteRepository r : originalResolver.getRepositories()) {
if (!ids.add(r.getId())) throw new IllegalStateException("Duplicate repo id: " + r.getId());
} Prevention
- Do not rename repository ids via mirrors; keep mirror <id> equal to the mirrored repo id
- Avoid configuring the same repo id in multiple profiles with different URLs
- Test registry resolution after any settings.xml mirror/proxy change
- Keep quarkus-registry-client and Maven resolver versions in sync
- Enable debug logging for registry resolution in CI to catch id drift early
When it happens
Trigger: The resolved descriptor's ArtifactResult reports a source repository id (not "local"/null) that does not match any RemoteRepository id in the resolver's effective repository list — e.g. resolution was served by a repository injected via a mirror with a rewritten id, or resolver/repo lists were customized inconsistently.
Common situations: Maven mirror settings rewriting repository ids so the effective repo id differs from the configured one; custom MavenRepositoryService/resolver wrappers that drop or rename repos; unusual settings.xml configurations mixing profiles with same-id repos; a Quarkus/Maven resolver version mismatch bug.
Related errors
- Failed to resolve extension catalog of ${platformCoords} [fr
- Failed to compose an error message
- Unable to determine groupId and artifactId of the jar that c
- Unable to determine groupId and artifactId of the extension
- Unable to determine groupId and artifactId of the jar that c
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/db1ae98e742d4c42.
Report an issue: GitHub.