maven-download-plugin: settings.xml proxy not being honored
I have an entry that looks like this in settings.xml
(note I have redacted DNS names due to my company policies):
<proxies>
<proxy>
<active>true</active>
<id>myProxy</id>
<protocol>http</protocol>
<host><redacted-proxy-host-name/></host>
<port>80</port>
<nonProxyHosts>*.<redacted>.com|*.<redacted>.com</nonProxyHosts>
</proxy>
</proxies>
In my pom file, I have this:
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.6.8</version>
<executions>
<execution>
<id>download-wit</id>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<uri>https://github.com/oracle/weblogic-image-tool/releases/latest/download/imagetool.zip</uri>
<overwrite>true</overwrite>
<outputFileName>imagetool.zip</outputFileName>
</configuration>
</execution>
</executions>
</plugin>
When I run the build, I get this:
[INFO] --- download-maven-plugin:1.6.8:wget (download-wit) @ wit-images ---
[WARNING] Could not get content
org.apache.http.conn.HttpHostConnectException: Connect to github.com:443 [github.com/192.30.255.112] failed: Operation timed out (Connection timed out)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect (DefaultHttpClientConnectionOperator.java:156)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect (PoolingHttpClientConnectionManager.java:376)
at org.apache.http.impl.execchain.MainClientExec.establishRoute (MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute (MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute (ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute (RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute (RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute (InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:221)
at org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:165)
at com.googlecode.download.maven.plugin.internal.HttpFileRequester.download (HttpFileRequester.java:56)
at com.googlecode.download.maven.plugin.internal.WGet.doGet (WGet.java:586)
at com.googlecode.download.maven.plugin.internal.WGet.execute (WGet.java:443)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.net.ConnectException: Operation timed out (Connection timed out)
at java.net.PlainSocketImpl.socketConnect (Native Method)
at java.net.AbstractPlainSocketImpl.doConnect (AbstractPlainSocketImpl.java:476)
at java.net.AbstractPlainSocketImpl.connectToAddress (AbstractPlainSocketImpl.java:218)
at java.net.AbstractPlainSocketImpl.connect (AbstractPlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect (SocksSocketImpl.java:394)
at java.net.Socket.connect (Socket.java:606)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket (SSLConnectionSocketFactory.java:368)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect (DefaultHttpClientConnectionOperator.java:142)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect (PoolingHttpClientConnectionManager.java:376)
at org.apache.http.impl.execchain.MainClientExec.establishRoute (MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute (MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute (ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute (RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute (RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute (InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:221)
at org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:165)
at com.googlecode.download.maven.plugin.internal.HttpFileRequester.download (HttpFileRequester.java:56)
at com.googlecode.download.maven.plugin.internal.WGet.doGet (WGet.java:586)
at com.googlecode.download.maven.plugin.internal.WGet.execute (WGet.java:443)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[WARNING] Retrying (1 more)
...
[ERROR] Failed to execute goal com.googlecode.maven-download-plugin:download-maven-plugin:1.6.8:wget (download-wit) on project wit-images: IO Error: Could not get content -> [Help 1]
If I download a file from a server inside the firewall, everything works perfectly. Seems like this plugin is not honoring the settings.xml proxy settings even though the source looks like it should.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (8 by maintainers)
Commits related to this issue
- Resolves #226 Resolves #224 Replacing Maven 2 APIs with modern ones. — committed to ajarmoniuk/maven-download-plugin by ajarmoniuk 2 years ago
- Resolves #226 Resolves #224 Replacing Maven 2 APIs with modern ones. — committed to ajarmoniuk/maven-download-plugin by ajarmoniuk 2 years ago
- #224, #226: Replacing Maven 2 APIs with Maven 3 (#227) Replacing Maven 2 APIs with modern ones — committed to maven-download-plugin/maven-download-plugin by ajarmoniuk 2 years ago
This is definitely working now! Thanks so much
For reference testing, I try to compile/install a direct clone of this plugin: https://github.com/5aab/randoop-maven-plugin (I only change the version number for the maven-download-plugin to 1.7.1). I’ve tried on my windows machine with a proxy setting.xml set correctly. I’ve also tried building within an ubuntu development container with proxy set through docker – everything else downloads correctly in maven, but wget cannot (slightly different logs). I can download the file in my browser, and even using wget on the command line fine. See attachments. maven-build-log-windows.txt maven-build-log-ubuntu.txt
I do notice in the browser it takes a while to establish connection – is there a way to increase the read timeout?
I think this can be closed.
I’m working on a PR which is doing away with
WagonManager
(since it’s being retired anyway) and other old cruft from Maven 2 and using the newRepositoryManager
from Maven 3 and 4 instead. Will give it a go and check if I can reporoduce your issue.