quarkus: Maven proxy usage is broken with Quarkus 3.0.2.Final

Describe the bug

Hi folks,

Unfortunately, with Quarkus 3 the proxy usage is not working anymore, at least in case proxy authentication (e.g. basic auth) is required. I’ve created a reproducer which should help to analyze the issue.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

  1. Clone https://github.com/techspace-de/quarkus3-proxy-auth-issue (Quarkus default app generated with Quarkus cli)
  2. You might need to update tinyproxy.conf to access the proxy within your local network. Currently Allow 172.0.0.0/8 is configured
  3. Start tinyproxy via docker compose up -d
  4. Execute ./mvnw clean test -s settings.xml

Build should fail with the following error: 407 Proxy Authentication Required

[ERROR] Plugin org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-failsafe-plugin:jar:3.0.0-M7: Could not transfer artifact org.apache.maven.plugins:maven-failsafe-plugin:pom:3.0.0-M7 fro
m/to central (https://repo.maven.apache.org/maven2): proxy authentication failed for https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-failsafe-plugin/3.0.0-M7/maven-failsafe-plugin-3.0.0-M7.pom, status: 407 Proxy Authentication Required -> [Help 1]
[ERROR]

There is an additional commit with Quarkus 2.16.7.Final, where everything works like a charm:

commit 21c56b74959a892351ca8497fb41b57119ec27c1
Author: Christian Berger <chberger@users.noreply.github.com>
Date:   Tue May 9 12:04:40 2023 +0200

    feat: Working example with Quarkus 2.16.7.Final

Please don’t forget to delete the local ./repo folder in order to force remote artifact loading …

Output of uname -a or ver

No response

Output of java -version

17

GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.0.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

3.8.8

Additional information

Based on my observation the issue might be related to changes in Maven. Even with Quarkus 2.16.7.Final it fails when using Maven 3.9.X.

It seems like they changed the Maven resolver transport implementation from wagon to another impl, at least starting from Maven 3.9.X --> https://maven.apache.org/guides/mini/guide-resolver-transport.html

In addition to that, once you remove the BasicAuth config in tinyproxy.conf everything works even with Quarkus 3 and Maven 3.9.X. So it’s somehow related to the proxy config in combination with authentication …

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 18 (16 by maintainers)

Commits related to this issue

Most upvoted comments

What’s actually happened is that we discovered that we were doing a number of things wrong which resulted in this issue:

  • Using the lightweight HTTP wagon, which doesn’t support proxy configuration very easily
  • Bringing in the obsolete org.sonatype.plexus artifacts by mistake, causing class overlaps and other problems
  • Duplicating some core Maven classes in the plugin class loader, causing a different kind of class overlap and related class-cast issues

The current status is that it’s mostly working, however the quarkus extension create mojo is still having trouble - there’s probably still a missing exclusion or something which has to be figured out. We’re using the more recent and supported transport providers now, and in the PR branch I’ve also added an enforcer rule for the org.sonatype plexus coordinates so hopefully they won’t creep back in either. Still working on the last problems.

I promise you I’ve learned nothing!

I’ve tested the following combinations:

Maven Quarkus Result
3.8.8 2.16.7.Final
3.9.1 2.16.7.Final
3.8.8 3.0.2.Final
3.9.1 3.0.2.Final

As mentioned, in my reproducer u can use mvnw which uses Maven 3.8.8