0

When I run "mvn install" on my guest VM box, I get multiple "Connection Timed Out" errors when searching for a file to download.

[WARNING] Unable to get resource 'org.apache.maven.wagon:wagon-file:pom:1.0-alpha-5' from repository maven-nexus (http://repository.jboss.org/nexus/content/groups/public): Error transferring file: Connection timed out

Note - I've opened the file path that maven can't find to Firefox and curl. Both of them can read/download the file based on the path that maven uses and cannot find.

I need to use a proxy, but I believe it's configured correctly. For a guest VM using a proxy, is it acceptable to use the same proxy settings as the host machine?

As I understand, port forwarding is only required from host to guest, but not vice-versa.

Please advise.

EDIT - Turns out it was a proxy issue. I had to configure my guest machine's proxy correctly.

Kevin Meredith
  • 1,269
  • 2
  • 15
  • 21

2 Answers2

1

As you can download the files with Firefox and curl (inside the vm?) i'd double check proxy settings for mvn.

1

Is VM a Linux? If yes, try:

export http_proxy=http://your_proxy:port
export ftp_proxy=$http_proxy
mvn install

If this does not help, you can

  • look at logs on proxy server(is there any connection attempt?)
  • use packet sniffer/analyzer program like Wireshark to see what actually is happening
Selivanov Pavel
  • 2,206
  • 3
  • 26
  • 48
  • It looks like my http_proxy environment variable was wrong. Does maven use these env vars that you listed? – Kevin Meredith Aug 14 '12 at 16:11
  • I don't know anything about maven, but I know that http_proxy and ftp_proxy are standard environment variables in unix to save proxy information. If this tip helped, maven uses them. – Selivanov Pavel Aug 14 '12 at 16:37
  • 1
    I believe that maven, a Java build tool, uses its settings.xml file, options passed in via the command line, and/or the $MAVEN_OPTS environment variable to find out, among others, what proxy to use. – Kevin Meredith Aug 22 '12 at 17:20