Maven 2 & 3
  1. Maven 2 & 3
  2. MNG-5162

Maven stuck on downloading dependencies when using java 7.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 3.0.1, 3.0.3
    • Fix Version/s: None
    • Component/s: Dependencies
    • Labels:
      None
    • Environment:
      Windows 7 Professional x64
    • Complexity:
      Intermediate
    • Number of attachments :
      4

      Description

      When JAVA_HOME is set to the Java 7 JDK and I run "mvn clean install" on my project the following happens:
      Maven downloads the dependencies to my local repository, as usual, but on some dependencies he stops while downloading and never continues. He is just stuck. I then must use CTRL+C and start from the beginning with my build, but it doesnt help because he gets stuck at the same dependencies again. In my local repository, where the failed dependency belongs is just a tmp file like: org.apache.servicemix.bundles.serp-1.13.1_4.jar.tmp90088a9d7e9e4642

      When I set JAVA_HOME to java 6 Update 27 everything works fine.
      The problem does not seem to be related to JAR size because, I saw it fail on 19kb dependencies as well.
      I have the impression it happens mostly to JARs with "long" names.

      Attached you will find a subproject of the project I am working on. it contains the org.apache.servicemix.bundles.serp-1.13.1_4 dependency, which is one of almost all servicemix bundles that is failing for me, when i use java7.

      1. dump.tdump
        13 kB
        Lukas Stampf
      1. java6.jpg
        140 kB
      2. java7.jpg
        66 kB

        Activity

        Hide
        Jukka Zitting added a comment -

        Setting MAVEN_OPTS to -Djava.net.preferIPv4Stack=true fixed this problem for me.

        Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
        Maven home: c:\Program Files\apache-maven-3.0.4
        Java version: 1.7.0_04, vendor: Oracle Corporation
        Java home: c:\Program Files\Java\jdk1.7.0_04\jre
        Default locale: en_GB, platform encoding: Cp1252
        OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
        
        Show
        Jukka Zitting added a comment - Setting MAVEN_OPTS to -Djava.net.preferIPv4Stack=true fixed this problem for me. Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100) Maven home: c:\Program Files\apache-maven-3.0.4 Java version: 1.7.0_04, vendor: Oracle Corporation Java home: c:\Program Files\Java\jdk1.7.0_04\jre Default locale: en_GB, platform encoding: Cp1252 OS name: "windows 7" , version: "6.1" , arch: "amd64" , family: "windows"
        Hide
        Damien Coraboeuf added a comment -

        Setting MAVEN_OPTS to -Djava.net.preferIPv4Stack=true

        It seems to do the trick as well I'm back to JDK7.

        Thanks,
        Damien.

        Show
        Damien Coraboeuf added a comment - Setting MAVEN_OPTS to -Djava.net.preferIPv4Stack=true It seems to do the trick as well I'm back to JDK7. Thanks, Damien.
        Hide
        Paolo Ambrosio added a comment -

        Jukka's suggestion fixed my problem as well.

        Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000)
        Java version: 1.7.0_05, vendor: Oracle Corporation
        OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"

        Show
        Paolo Ambrosio added a comment - Jukka's suggestion fixed my problem as well. Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000) Java version: 1.7.0_05, vendor: Oracle Corporation OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
        Hide
        Barrie Treloar added a comment -

        This is probably not a bug with Maven but with Java and the IP stack selection.

        Since there is a workaround (i.e. for IPv4), will close this as not a bug.

        Documented at https://cwiki.apache.org/confluence/display/MAVEN/ConnectException

        Show
        Barrie Treloar added a comment - This is probably not a bug with Maven but with Java and the IP stack selection. Since there is a workaround (i.e. for IPv4), will close this as not a bug. Documented at https://cwiki.apache.org/confluence/display/MAVEN/ConnectException
        Hide
        Barrie Treloar added a comment -

        Added code to exception handling to link to https://cwiki.apache.org/confluence/display/MAVEN/ConnectException

        Show
        Barrie Treloar added a comment - Added code to exception handling to link to https://cwiki.apache.org/confluence/display/MAVEN/ConnectException

          People

          • Assignee:
            Unassigned
            Reporter:
            Lukas Stampf
          • Votes:
            6 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: