Skip to content

Maven 3.9 resolver ignores proxy authentification system properties proxyUser and proxyPassword #2139

Description

@npen

Affected version

3.9.16

Bug description

Following issue #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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions