{"record":{"id":"ee27adbbf58bad18","repo":"apache/maven","slug":"unable-to-lookup-org-eclipse-aether-repositorysyst","errorCode":null,"errorMessage":"Unable to lookup org.eclipse.aether.RepositorySystem","messagePattern":"Unable to lookup org\\.eclipse\\.aether\\.RepositorySystem","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"compat/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java","lineNumber":193,"sourceCode":"        }\n\n        if (!artifact.isResolved()) {\n            ArtifactResult result;\n\n            try {\n                ArtifactRequest artifactRequest = new ArtifactRequest();\n                artifactRequest.setArtifact(RepositoryUtils.toArtifact(artifact));\n                artifactRequest.setRepositories(RepositoryUtils.toRepos(remoteRepositories));\n\n                // Maven 2.x quirk: an artifact always points at the local repo, regardless whether resolved or not\n                LocalRepositoryManager lrm = session.getLocalRepositoryManager();\n                String path = lrm.getPathForLocalArtifact(artifactRequest.getArtifact());\n                artifact.setFile(new File(lrm.getRepository().getBasedir(), path));\n\n                RepositorySystem repoSystem = container.lookup(RepositorySystem.class);\n                result = repoSystem.resolveArtifact(session, artifactRequest);\n            } catch (ComponentLookupException e) {\n                throw new IllegalStateException(\"Unable to lookup \" + RepositorySystem.class.getName());\n            } catch (org.eclipse.aether.resolution.ArtifactResolutionException e) {\n                if (e.getCause() instanceof org.eclipse.aether.transfer.ArtifactNotFoundException) {\n                    throw new ArtifactNotFoundException(e.getMessage(), artifact, remoteRepositories, e);\n                } else {\n                    throw new ArtifactResolutionException(e.getMessage(), artifact, remoteRepositories, e);\n                }\n            }\n\n            artifact.selectVersion(result.getArtifact().getVersion());\n            artifact.setFile(result.getArtifact().getFile());\n            artifact.setResolved(true);\n\n            if (artifact.isSnapshot()) {\n                Matcher matcher = Artifact.VERSION_FILE_PATTERN.matcher(artifact.getVersion());\n                if (matcher.matches()) {\n                    Snapshot snapshot = new Snapshot();\n                    snapshot.setTimestamp(matcher.group(2));\n                    try {","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java#L175-L211","documentation":"DefaultArtifactResolver obtains the Eclipse Resolver via container.lookup(RepositorySystem.class); a ComponentLookupException becomes IllegalStateException with this message (note: the cause is not even chained). It means the Maven DI container (Plexus/Sisu) has no org.eclipse.aether.RepositorySystem component registered - the runtime itself is wired incorrectly. This is an installation or embedding defect, not a project configuration problem.","triggerScenarios":"Calling resolve(...) in an environment where the DI container lacks the RepositorySystem component: a corrupted Maven distribution with mixed/patched jars in MAVEN_HOME/lib, an embedded Maven classpath (maven-embedder + maven-compat) missing the resolver provider modules, or a plugin that manipulates the container and drops the component.","commonSituations":"Partial Maven upgrades leaving lib jars from different versions; applications embedding maven-compat without the complete Maven + Resolver component set; legacy plugins forcing an incompatible plexus-container-default onto the classpath; hand-patched maven-core jars.","solutions":["Replace the Maven installation with a fresh official distribution (full replacement, not file-by-file) and verify mvn -v works","In embedded setups, add the complete resolver wiring: maven-resolver-provider plus sisu/plexus default containers, or bootstrap via maven-embedder's MavenCli","Detect and exclude conflicting plexus-container-default / sisu versions pulled transitively by old plugins (mvn dependency:tree on the embedding project)","If the local repository also corrupted core artifacts, wipe ~/.m2/repository/org/eclipse/aether and org/apache/maven so they are re-fetched"],"exampleFix":"<!-- before: only maven-compat on the classpath, no resolver wiring -->\n<dependency>\n  <groupId>org.apache.maven</groupId>\n  <artifactId>maven-compat</artifactId>\n</dependency>\n<!-- after: full embedding set incl. resolver provider -->\n<dependency>\n  <groupId>org.apache.maven</groupId>\n  <artifactId>maven-embedder</artifactId>\n</dependency>\n<dependency>\n  <groupId>org.apache.maven.resolver</groupId>\n  <artifactId>maven-resolver-provider</artifactId>\n</dependency>","handlingStrategy":"try-catch","validationCode":"try {\n    container.lookup(org.eclipse.aether.RepositorySystem.class);\n} catch (org.codehaus.plexus.component.repository.exception.ComponentLookupException e) {\n    // container not wired for artifact resolution: fix the classpath/installation\n}","typeGuard":null,"tryCatchPattern":"Catch IllegalStateException with message 'Unable to lookup org.eclipse.aether.RepositorySystem' and abort: treat it as an environment failure and repair the Maven installation/embedded classpath; retrying the same call cannot succeed.","preventionTips":["Upgrade Maven by full distribution replacement; never mix jars across versions in MAVEN_HOME/lib.","In embedded use, depend on maven-embedder + maven-resolver-provider rather than maven-compat alone.","Verify embedded classpaths with dependency:tree for duplicate plexus/sisu containers.","Smoke-test environments with mvn -v before running real builds."],"tags":["maven","dependency-injection","plexus","sisu","resolver","embedding","installation"],"backgroundTag":"dependency-injection-lookup-failed","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}