{"record":{"id":"5a5f5486f4e4c0e5","repo":"apache/maven","slug":"not-implemented-yet","errorCode":null,"errorMessage":"Not implemented yet","messagePattern":"Not implemented yet","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"impl/maven-impl/src/main/java/org/apache/maven/impl/AbstractSession.java","lineNumber":297,"sourceCode":"\n    @Override\n    public List<org.eclipse.aether.repository.RemoteRepository> toRepositories(List<RemoteRepository> repositories) {\n        return repositories == null ? null : map(repositories, this::toRepository);\n    }\n\n    @Override\n    public List<org.eclipse.aether.repository.RemoteRepository> toResolvingRepositories(\n            List<RemoteRepository> repositories) {\n        return getRepositorySystem().newResolutionRepositories(getSession(), toRepositories(repositories));\n    }\n\n    @Override\n    public org.eclipse.aether.repository.RemoteRepository toRepository(RemoteRepository repository) {\n        if (repository instanceof DefaultRemoteRepository defaultRemoteRepository) {\n            return defaultRemoteRepository.getRepository();\n        } else {\n            // TODO\n            throw new UnsupportedOperationException(\"Not implemented yet\");\n        }\n    }\n\n    @Override\n    public org.eclipse.aether.repository.LocalRepository toRepository(LocalRepository repository) {\n        if (repository instanceof DefaultLocalRepository defaultLocalRepository) {\n            return defaultLocalRepository.getRepository();\n        } else {\n            // TODO\n            throw new UnsupportedOperationException(\"Not implemented yet\");\n        }\n    }\n\n    @Override\n    public List<org.eclipse.aether.graph.Dependency> toDependencies(\n            Collection<DependencyCoordinates> dependencies, boolean managed) {\n        return dependencies == null ? null : map(dependencies, d -> toDependency(d, managed));\n    }","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-impl/src/main/java/org/apache/maven/impl/AbstractSession.java#L279-L315","documentation":"Session.toRepository(RemoteRepository) converts a Maven API RemoteRepository to the Eclipse Resolver type by casting to the internal DefaultRemoteRepository and unwrapping the delegate. The Maven API interfaces are not currently open for user implementations, so any non-DefaultRemoteRepository instance cannot be converted and throws UnsupportedOperationException marked with a TODO. The same applies to other toXxx converters: only session-produced default implementations are convertible.","triggerScenarios":"Implementing org.apache.maven.api.RemoteRepository yourself (or obtaining one from another framework) and passing it to session.toRepository(...), toResolvingRepositories(...), or any API (e.g. ArtifactResolverRequest/ArtifactDeployerRequest) that internally converts repositories via the session.","commonSituations":"Custom repository wrappers or mocks in tests that implement the RemoteRepository interface instead of building one through Session.createRemoteRepository(...); library code written against the interfaces assuming they are implementable.","solutions":["Create repositories through the session API: session.createRemoteRepository(...) so you get a DefaultRemoteRepository the session can convert","If you need custom repository behavior, wrap at the resolver level (RepositorySystemSession config) rather than the Maven API level","In tests, mock the Session or use the standalone session factory instead of hand-implemented repository records"],"exampleFix":"// before\nRemoteRepository repo = new MyRemoteRepository('central', 'https://repo.maven.apache.org/maven2');\nList<org.eclipse.aether.repository.RemoteRepository> repos = session.toRepositories(List.of(repo)); // throws\n\n// after\nRemoteRepository repo = session.createRemoteRepository('central', 'https://repo.maven.apache.org/maven2', 'default');\nList<org.eclipse.aether.repository.RemoteRepository> repos = session.toRepositories(List.of(repo));","handlingStrategy":"type-guard","validationCode":"if (!(remoteRepo instanceof DefaultRemoteRepository)) {\n    throw new IllegalArgumentException('RemoteRepository must be created by the session');\n}","typeGuard":"static boolean isConvertible(RemoteRepository r) { return r instanceof DefaultRemoteRepository; }","tryCatchPattern":null,"preventionTips":["Always create remote repositories via session.createRemoteRepository(...)","Do not implement org.apache.maven.api interfaces yourself","In tests, mock the Session rather than hand-rolling repository records"],"tags":["maven","maven-api","remote-repository","unsupported-operation"],"backgroundTag":"unsupported-implementation","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}