What Offline Mode Is Blocking
Maven is running with offline mode enabled (-o / --offline), so it will not contact remote repositories to download missing artifacts.
Go back online or pre-seed the local repository
Disable offline mode and retry the build (remove -o / --offline).
If offline mode is set in .mvn/maven.config, remove it (or make it conditional) and re-run the command.
If you must run offline (CI/air-gapped), pre-populate the local repository (for example by running the build once online, or by using a repository manager/cache that is reachable from the build environment).
Retry the build after artifacts are available locally.
Check whether the artifact is already cached locally
Check your Maven invocation for -o / --offline, check .mvn/maven.config in the project for -o (offline mode can be enforced there), and confirm whether the missing artifacts exist locally under ~/.m2/repository/.
Typical Output
[ERROR] Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.example:lib:jar:1.2.3 has not been downloaded from it before.
[ERROR] Cannot access internal (https://repo.example.com/maven) in offline mode Why Offline Mode Blocks This Build
Usually this comes down to offline mode was enabled intentionally (air-gapped builds, flaky networks) but required artifacts were not pre-cached, offline mode was enabled unintentionally via .mvn/maven.config or a CI template, or the local repository cache was cleared or is using a different maven.repo.local path than expected.
Prove the Local Repository Has What the Build Needs
Re-run the original Maven goal and confirm it can resolve dependencies without offline-mode errors, and confirm the previously missing artifacts now exist in ~/.m2/repository/.
What Maven offline mode does
In offline mode, Maven only uses the local repository cache (~/.m2/repository). If an artifact is missing locally, Maven cannot download it and the build fails. Offline mode can be enabled explicitly on the command line or implicitly via project/CI configuration.
Avoid Command and Config Drift
To prevent this, use a repository manager inside the network so builds do not depend on public internet access, if you use offline mode in CI, ensure caches are warmed and persisted between runs, and document where offline mode is configured (.mvn/maven.config, CI templates) to avoid surprises.
Docs and source code
github.com/apache/maven/blob/maven-3.9.6/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
Offline-mode errors are raised by the underlying resolver layer and bubbled up into Maven via the exception message (e.getMessage()). - GitHub
String msg = "Could not resolve dependencies for project " + project.getId() + ": " + e.getMessage();
DependencyResolutionException dex = new DependencyResolutionException(msg, e);
dex.setResult(e.getResult());
throw dex;