-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quarkus build does not use the proxy settings in maven settings.xml #27841
Comments
/cc @evanchooly, @geoand, @quarkusio/devtools |
cc @aloubyansky |
@smil2k thanks for reporting the issue. Could you please give a settings.xml (snippet) with a proxy config as an example? I suppose it's nothing extraordinary but just in case. Thanks. |
|
Haven't been able to reproduce it so far. Here is what I tried:
The idea was that if the Quarkus resolver was not applying the proxy settings to the configured repos I would see a request to a Maven repo with port I see it's failing on |
It would be even more convenient if |
@aloubyansky It is not the build which fails but the integration test. It is downloading the runtime parts of the extensions. Probably the forked process is doing it. |
Try the following:
mvn clean install maven will use the proxy, and during surefire execution it will try to download extra jars, which are not part of the build. i can try to reproduce it with -X maybe I can offer a stacktrace. I think you tried something similar, just with custom nexus. |
@aloubyansky thanks for your comment. To be more specific, here is a SSCCE: quarkus create app org.acme:getting-started
cd getting-started
quarkus build --verbose This fails with $ quarkus build --verbose
[DEBUG] Build project with initial parameters: Build [buildOptions=BuildOptions [buildNative=false, clean=false, offline=false, skipTests=false], properties={}, output=OutputOptions [testMode=false, showErrors=false, verbose=true], params=[]]
/Users/Q453358/tmp/proxy/getting-started/mvnw -Dstyle.color=always -DquarkusRegistryClient=true install
Exception in thread "main" java.net.UnknownHostException: repo.maven.apache.org
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:572)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
at java.base/java.net.Socket.connect(Socket.java:633)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304)
at java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:174)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:533)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:638)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at org.apache.maven.wrapper.DefaultDownloader.downloadInternal(DefaultDownloader.java:95)
at org.apache.maven.wrapper.DefaultDownloader.download(DefaultDownloader.java:85)
at org.apache.maven.wrapper.Installer.createDist(Installer.java:84)
at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:160)
at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:73) When running the command, which was printed (without the mvn -Dstyle.color=always -DquarkusRegistryClient=true install
[INFO] Scanning for projects...
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.893 s
[INFO] Finished at: 2023-07-25T13:21:11+02:00
[INFO] ------------------------------------------------------------------------
Here is my proxy config: $ env | grep -iE https?_proxy
https_proxy=http://localhost:3128
HTTPS_PROXY=http://localhost:3128
HTTP_PROXY=http://localhost:3128
http_proxy=http://localhost:3128
$ cat ~/.m2/settings.xml
<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<proxies>
<proxy>
<id>local</id>
<active>true</active>
<protocol>http</protocol>
<host>localhost</host>
<port>3128</port>
</proxy>
</proxies>
</settings> Where So all I am saying is that quarkus should either enable reading the proxy config from the For reference, some version info: $ mvn --version
Apache Maven 3.9.3 (21122926829f1ead511c958d89bd2f672198ae9f)
Maven home: /usr/local/Cellar/maven/3.9.3/libexec
Java version: 17.0.8, vendor: Homebrew, runtime: /usr/local/Cellar/openjdk@17/17.0.8/libexec/openjdk.jdk/Contents/Home
Default locale: en_DE, platform encoding: UTF-8
OS name: "mac os x", version: "13.4.1", arch: "x86_64", family: "mac"
$ quarkus --version
3.2.2.Final |
Thanks, so it's a Maven wrapper issue? Does it fail with |
No it is a bit different. (Albeit it might have similar ground). My problem is during testing, wrapper is not involved. |
@aloubyansky yes, it fails with the same exception as $ ./mvnw -Dstyle.color=always -DquarkusRegistryClient=true install
Exception in thread "main" java.net.UnknownHostException: repo.maven.apache.org
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:572)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
at java.base/java.net.Socket.connect(Socket.java:633)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304)
at java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:174)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:533)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:638)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at org.apache.maven.wrapper.DefaultDownloader.downloadInternal(DefaultDownloader.java:95)
at org.apache.maven.wrapper.DefaultDownloader.download(DefaultDownloader.java:85)
at org.apache.maven.wrapper.Installer.createDist(Installer.java:84)
at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:160)
at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:73) |
Ok, thanks for the info. The quarkusRegistryClient isn't relevant for install, btw, in case you run these commands yourself. |
@dastrobu have you tried adding proxy properties to
@smil2k I've been kind of struggling setting up a reproducer. In case you could look into providing a reproducer using a tinyproxy or squid docker image, it'd be highly appreciated. |
@aloubyansky I was thinking in lines a docker compose file: build and proxy and firewall the build docker from accessing the internet. What do you think? Regarding -Dhttp.proxy, it used to work, probably in the 2.x era, but now it is not working anymore. Even if I put it into JAVA_TOOL_OPTIONS. |
Sure, I'll give it a try @smil2k |
As to the -Dhttp.proxy that's for the wrapper. The wrapper is a plain Java client, not a maven resolver transport. |
@aloubyansky somehow I am not able to reproduce the error anymore, with or without the |
@dastrobu thanks for checking, let us know in case you hit it again. |
@smil2k not sure it'll help your case but just in case you may want to check #34875 (comment) |
Thanks, this seems to be relevant, I’ll try to apply the patch to my pom. |
I can simulate the environment using docker:
plus
and a settings.xml in the m2 directory, contents can be found above. The added host to repo.maven disables normal downloads, the downloads are enabled though the proxy entry. It seems that I was not able to reproduce the problem yet. But this might be connected to the issue you pointed me to. Can be the maven docker image does something special to the maven. (extra env vars or similar). I'll try it with some vanilla image next. |
Thanks a lot for looking into this @smil2k. Do builds still fail in your actual build environment though? |
Fixed by 3.2.4 |
@smil2k did you have to adjust your project config beyond simply upgrading the Quarkus version to fix your builds? |
Just by using the latest the problem resolved. |
Great, thanks @smil2k |
Describe the bug
In case of changing the quarkus version the first build has to be called with implicit java proxy settings on the command line in order to get a build behind proxy.
Maven downloads all the necessary jars, but some of them are downloaded by the quarkus plugin which does not honor the setting.
Expected behavior
in case the setting is set in maven, every plugin should honor it.
Actual behavior
Stuck here and times out.
How to Reproduce?
Delete quarkus version and rebuild something with tests inside.
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.2.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: