apache / apache/maven-resolver

Maven 3.9 resolver ignores proxy authentification system properties proxyUser and proxyPassword

Open
#2,139 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
152
Forks
160
Avg merge
1d 4h
Merged PRs (30d)
49

Description

### Affected version

3.9.16

### Bug description

Following issue https://github.com/apache/maven-resolver/issues/997 resolution, it is possible to use aether.connector.http.useSystemProperties=true to allow the use of proxyHost and proxyPort system properties.

However, the call to setDefaultCredentialsProvider which happens just before will lead to completely ignore the related authentication properties https.proxyUser and https.proxyPassword.

I know using system properties is discouraged, here is my use-case:

Running Claude Code in sandboxed mode on MacOS X, command run by Claude has to go through a proxy whose parameters (host, port, user and password) are available in environment variable HTTPS_PROXY. It's worth to note that those parameters are not fixed and change on every sessions.

In the end, Claude ends up debugging maven commands, and duplicate settings.xml with proxy config added, and additional parameters to mvn commands.

I tried to setup a simple .mavenrc file to declare correct MAVEN_OPTS dynamically based on HTTPS_PROXY variable. This works fine, except that https.proxyUser and https.proxyPassword are completely ignored, leading to HTTP 407 errors.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the resolution of maven-resolver issue 997 and tracing the setDefaultCredentialsProvider call when aether.connector.http.useSystemProperties=true. Verify the https.proxyUser and https.proxyPassword system properties are honored alongside proxyHost and proxyPort, avoiding the reported HTTP 407 errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.