Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1507

Maven can't download resource from central when behind a proxy and won't use local repository

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8
    • 0.12.0
    • Java - Library
    • Ubuntu 10.04 LTS, running in a VM in VMWare Player hosted on Windows XP Pro which is behind a proxy server.

    Description

      When 'make' enters lib/java, the build fails on the mvn.init target with:
      . . .
      [artifact:dependencies] [WARNING] Overriding profile: 'maven-ant-tasks-repo-profile' (source: pom) with new instance from source: pom
      [artifact:dependencies] Downloading: org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.pom from repository central at http://repo1.maven.org/maven2
      [artifact:dependencies] Error transferring file: Connection refused
      [artifact:dependencies] [WARNING] Unable to get resource 'org.slf4j:slf4j-api:pom:1.5.8' from repository central (http://repo1.maven.org/maven2): Error transferring file: Connection refused
      . . .

      This occurs for every dependency in the 'pom' artifact (on some files, the error is "Connection timed out").

      The preceding target, mvn.ant.tasks.download, succeeds (the maven-ant-tasks-2.1.3.jar file is sitting in the tools directory).

      I have added to build.xml:
      proxy.host=proxy1.domain.com
      proxy.port=80
      proxy.user=
      proxy.pass=
      proxy.enabled=true

      and to /etc/maven2/settings.xml:
      <proxy>
      <id>proxy1</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy1.domain.com</host>
      <port>80</port>
      <nonProxyHosts>localhost</nonProxyHosts>
      </proxy>

      Maven does not seem to be picking up the proxy. If I manually download all the resources and install them into my local repository (~/.m2/repository) as suggested and re-run make, I still get the errors – Maven doesn't try to use the local repository.

      If I move the machine out from behind the firewall, everything works fine: Maven downloads all the dependencies and the Java stuff is able to be built. If I then put the machine back behind the firewall and run 'sudo make install', Maven again tries to download the dependencies from central and that, of course, fails. It doesn't realize that all the dependencies have been downloaded and the Java files have been compiled.

      Attachments

        Activity

          People

            jking3 James E. King III
            a440guy Mark Anderson
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: