How can I adjust timeout for mvn mirror on dependency:resolve -- Error transferring file: Read timed out
Asked Answered
S

1

7

Does anyone know how to control the timeout settings for a mirror in the maven settings file or in the dependency plugin?

I see that I can modify timeout settings for a server but not a repository or a mirror.

Problem

Since upgrading nexus oss from 1.8.0 to 2.3x and moving to a VM I'm seeing intermittent problems with timeouts and nothing useful in the nexus debug log alas. I figure I have two options: improve nexus server performance or configure maven settings to wait longer for artifacts.

I don't see much to do with my server so I'm looking into the maven side.

Maven Error on Dependency Resolve

Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project foo: 

from/to snapshots (http://mycorp.com/nexus/content/repositories/snapshots): Error transferring file: Read timed out -> [Help 1]

Please let me know if you know to configure maven's wagon etc. to relax its timeout.

Smew answered 5/4, 2013 at 15:28 Comment(0)
S
3

Try a simple http get to see what performance you get outside of Maven first. Might be a proxy issue or so.

Wagon is the name of the component doing HTTP transport in Maven and you can find some more info and config tips at http://maven.apache.org/guides/mini/guide-http-settings.html

Showalter answered 5/4, 2013 at 19:48 Comment(6)
It is an intermittent problem. So, that would work and maven dependency would work later on as well. It makes it somewhat difficult to test/fixSmew
If it intermittent you need to figure out what goes wrong at the time. Probably a network or load problem.Showalter
Thanks. Do you know of anyway to adjust the timeout? I tried but there's no evidence of the change taking effect in the effective-pom or when running mvn using -XSmew
Updated the answer .. maybe that helpsShowalter
Excellent, that does help. I've been looking at settings reference which was the wrong direction. I haven't done much with the wagon so I guess this is my chance to dive deep. ThanksSmew
Looking at that link, it says that "With Wagon 2.0 and Apache Maven 3.0.4, a default timeout of 30 minutes comes by default." Was your file really not downloaded after 30 minutes? I'm getting a Read Time Out error after only a few minutes.Yate

© 2022 - 2024 — McMap. All rights reserved.