If Maven cannot resolve a dependency but your Java app runs correctly, check Maven’s network settings first. Artifact downloads happen during the build. They do not inherit client-specific proxy settings from the Java application that the build produces.
Put the proxy in your Maven settings
Use a separate user settings file for the first check. Replace the example hostname and port with your approved proxy. The pipe-separated nonProxyHosts patterns are examples; keep only hosts that your organization explicitly allows to be contacted directly. A private Maven mirror is not automatically an exception. See Apache Maven’s proxy guide.
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0">
<proxies>
<proxy>
<id>corporate</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.example.com</host>
<port>3128</port>
<nonProxyHosts>localhost|127.0.0.1|*.example.internal</nonProxyHosts>
</proxy>
</proxies>
</settings>
Keep secrets out of shared project files. Proxy credentials authenticate to the network intermediary; Maven repository credentials authenticate to the mirror or registry and belong under the matching server ID in your settings. Use the credential mechanism approved for your installed Maven version.
Test resolution without a warm Maven cache
From a small, approved Maven project in PowerShell, set MEXELA_MAVEN_SETTINGS to the test settings file and MEXELA_MAVEN_CACHE to a new disposable repository directory you control. Choose a project whose parent POM must be fetched and has no local relative parent. An empty project might reach validate without downloading anything.
mvn -s "$env:MEXELA_MAVEN_SETTINGS" "-Dmaven.repo.local=$env:MEXELA_MAVEN_CACHE" -B validate
Look for the expected parent artifact in the new cache and, where available, confirm the request in an approved proxy log. Avoid sharing raw debug output that might contain paths, hostnames or credentials.
Separate proxy, repository and Java trust errors
| Build error | What to inspect |
|---|---|
| 407 | The corporate proxy’s authentication policy. |
| 401 or 403 from the mirror | The repository account, permissions, mirror ID and server settings. |
| PKIX or certificate error | The trust store of the JDK Maven is actually running. Use approved CA material; do not disable certificate validation. |
| Artifact not found | Coordinates, version, selected mirror and repository policy. |
If requests from the finished Java app fail instead, use the Java HttpClient and OkHttp guide. Both articles are part of the developer integration hub.
Verification, December 5, 2026: Apache Maven 3.10.2 read the displayed settings structure and resolved a fixture parent POM through a loopback proxy into a new local cache. A separate empty-cache build failed when the proxy returned 407. The disposable lab changed only the template host and port; it did not contact Maven Central.
Why does Maven work locally but fail in an IDE or CI?
Compare the Maven distribution, Java runtime, and user settings file selected by each launcher. Run mvn -version in the environment where the build fails, or inspect the IDE’s Maven runner settings if the IDE starts Maven itself. Check for an explicit -s file and verify which global and user settings the build uses. They are merged according to the Maven settings reference.
Repeat the small dependency-resolution check with the same parent artifact, the intended settings file, and a fresh disposable local repository. Capture the selected mirror, Maven and Java versions, and the first error with secrets removed. This comparison can reveal a different mirror or Java trust store that a warm local cache concealed.
