{"record":{"id":"a6ea258184e39324","repo":"apache/maven","slug":"unable-to-lookup","errorCode":null,"errorMessage":"Unable to lookup {}","messagePattern":"Unable to lookup (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"warning","filePath":"compat/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java","lineNumber":111,"sourceCode":"        factory.setGlobalUpdatePolicy(updatePolicy);\n    }\n\n    @Override\n    public void setGlobalChecksumPolicy(String checksumPolicy) {\n        factory.setGlobalChecksumPolicy(checksumPolicy);\n    }\n\n    private ArtifactRepository injectSession(ArtifactRepository repository, boolean mirrors) {\n        RepositorySystemSession session = legacySupport.getRepositorySession();\n\n        if (session != null && repository != null && !isLocalRepository(repository)) {\n            List<ArtifactRepository> repositories = Arrays.asList(repository);\n\n            RepositorySystem repositorySystem;\n            try {\n                repositorySystem = container.lookup(RepositorySystem.class);\n            } catch (ComponentLookupException e) {\n                throw new IllegalStateException(\"Unable to lookup \" + RepositorySystem.class.getName());\n            }\n\n            if (mirrors) {\n                repositorySystem.injectMirror(session, repositories);\n            }\n\n            repositorySystem.injectProxy(session, repositories);\n\n            repositorySystem.injectAuthentication(session, repositories);\n        }\n\n        return repository;\n    }\n\n    private boolean isLocalRepository(ArtifactRepository repository) {\n        // unfortunately, the API doesn't allow to tell a remote repo and the local repo apart...\n        return \"local\".equals(repository.getId());\n    }","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java#L93-L129","documentation":"The build runs offline (-o/--offline or offline=true in settings) and the mojo's descriptor declares requiresOnline=true, so Maven skips that execution entirely and logs this warning naming the goal. Anything the goal would have produced, such as generated sources or reports, is simply absent from this build.","triggerScenarios":"mvn -o combined with a plugin whose mojo is annotated @RequiresOnline: code generators downloading schemas, license checkers, or documentation mojos that must reach the network.","commonSituations":"Air-gapped CI and laptop builds; CI that pre-cached dependencies with dependency:go-offline but not the plugin's own runtime downloads.","solutions":["Run that goal or module online, or drop -o for the whole build","Warm the repository first: mvn dependency:go-offline (plus the plugin's own fetch goal if it has one), then go offline","Deactivate the online-only plugin when building offline via a profile or skip flag","Check with the plugin maintainer whether a cached or offline mode exists"],"exampleFix":"# before\nmvn -o verify   # warns: Goal 'openapi:generate' requires online mode, skipping\n# after: run online for this goal\nmvn verify","handlingStrategy":"validation","validationCode":"# warm everything the build downloads before switching to offline mode\nmvn dependency:go-offline -Dmaven.repo.local=$REPO\nmvn -o -Dmaven.repo.local=$REPO clean verify","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run one online build after dependency or plugin changes, then go offline","Deactivate online-only plugins through a profile keyed on the offline flag","Audit candidate plugins for @RequiresOnline before adopting air-gapped builds"],"tags":["maven","offline-mode","mojo-execution","maven-embedder"],"backgroundTag":"maven-offline-mode","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}