Maven failing to download jar dependencies

Andre :

I have a very simple default application that I've created to test my Eclipse Indigo/Maven v3.0.1 setup on my Windows 7 machine. The Hello World app runs fine from Eclipse.

Now from the command line I'm trying to test with mvn install.

At which point I see Maven download a large series of dependencies. For some reason though it will get stuck downloading one and will just stop part way through. It's not at the same point each time, but it's currently consistently the same jar file, eg...

http://repo1.maven.org/maven2/org/apache/maven/surefire/surefire-booter/2.5/surefire-booter-2.5.jar

If I download this file from a browser it works perfectly. Quite fast in fact. Now if I manually copy that downloaded file to the appropriate directory in my .m2 repository directory, the install continues to download dependencies until it hits another one at random which it stops at.

Here's my POM, although I'm not sure it'll help as it's so basic and seems to work fine with a mvn compile.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.kyeema</groupId>
  <artifactId>QServer</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>QServer</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

Here's some debug output referencing some dummy jar file?

[INFO] Surefire report directory: C:\workspace\QServer\target\surefire-reports
[DEBUG] Setting system property [user.dir]=[C:\workspace\QServer]
[DEBUG] Setting system property [localRepository]=[C:\Users\Andre\.m2\repository]
[DEBUG] Setting system property [basedir]=[C:\workspace\QServer]
[DEBUG] Using JVM: C:\Program Files\Java\jdk1.7.0\jre\bin\java
[DEBUG] dummy:dummy:jar:1.0 (selected for null)
[DEBUG]   org.apache.maven.surefire:surefire-booter:jar:2.7.2:compile (selected for compile)
[DEBUG]     org.apache.maven.surefire:surefire-api:jar:2.7.2:compile (selected for compile)
[DEBUG] Adding to surefire booter test classpath: C:\Users\Andre\.m2\repository\org\apache\maven\surefire\surefire-booter\2.7.2\surefire-booter-2.7.2.jar Scope: compile
[DEBUG] Adding to surefire booter test classpath: C:\Users\Andre\.m2\repository\org\apache\maven\surefire\surefire-api\2.7.2\surefire-api-2.7.2.jar Scope: compile
[DEBUG] dummy:dummy:jar:1.0 (selected for null)
[WARNING] Missing POM for org.apache.maven.surefire:surefire-junit3:jar:2.7.2: Error resolving project artifact: Failure to find org.apache.maven.surefire:surefire-junit3:pom:2.7.2 in http://mirrors.ibiblio.org/pub/mirrors/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of ibiblio.org has elapsed or updates are forced for project org.apache.maven.surefire:surefire-junit3:pom:2.7.2
[DEBUG]   org.apache.maven.surefire:surefire-junit3:jar:2.7.2:test (selected for test)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.626s
[INFO] Finished at: Tue Aug 16 13:18:42 PDT 2011
[INFO] Final Memory: 8M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test (default-test) on project QServer: Error to resolving surefire provider dependency: Missing:
[ERROR] ----------
[ERROR] 1) org.apache.maven.surefire:surefire-junit3:jar:2.7.2
[ERROR] 
[ERROR] Try downloading the file manually from the project website.
[ERROR] 
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven.surefire -DartifactId=surefire-junit3 -Dversion=2.7.2 -Dpackaging=jar -Dfile=/path/to/file
[ERROR] 
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven.surefire -DartifactId=surefire-junit3 -Dversion=2.7.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR] Path to dependency:
[ERROR] 1) dummy:dummy:jar:1.0
[ERROR] 2) org.apache.maven.surefire:surefire-junit3:jar:2.7.2
[ERROR] 
[ERROR] ----------
[ERROR] 1 required artifact is missing.
[ERROR] 
[ERROR] for artifact:
[ERROR] dummy:dummy:jar:1.0
[ERROR] 
[ERROR] from the specified remote repositories:
[ERROR] ibiblio.org (http://mirrors.ibiblio.org/pub/mirrors/maven2, releases=true, snapshots=false)
Andre :

Well for what it's worth, here's the answer to what I've been experiencing.

If I leave Maven at v3.0.1 I have to add the mirror listed above and it works fine.

If I upgrade Maven to v3.0.3 then I have to remove the mirror listed above to make it work. :-)

I tried this on two separate machines and had identical behaviour. This could mean the network here is to blame as they both go through the same router.

Anyway, so there's essentially two workarounds there. I'm not sure if either are the "correct" response, but they keep me moving forward at least.

Thanks to all that submitted answers.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

jar download with dependencies from maven

From Dev

failing to download a dependencies with sbt

From Dev

How to let bazel recursively download dependencies by maven_jar in java

From Java

Maven dependencies are failing with a 501 error

From Dev

Maven download dependencies

From Dev

Maven fails to download dependencies

From Java

Maven jar with dependencies?

From Java

Including dependencies in a jar with Maven

From Dev

Building jar with dependencies maven

From Dev

maven build failing to download com.lowagie:itext:jar:2.1.7.js6 dependency

From Dev

Maven Dependencies downloaded but build is failing with StackOverflowError

From Java

Spring 3.0.0 dependencies download with Maven

From Dev

Maven shade plugin - Jar and dependencies

From Dev

Maven not adding all dependencies to jar

From Java

Maven deploy jar with dependencies to repo

From Java

Maven: Add local dependencies to jar

From Dev

The maven dependencies are not added to the jar in eclipse

From Dev

Maven jar without dependencies by default

From Dev

Maven building a jar with dependencies unpacked inside the JAR

From Dev

Maven failing to download artifact from proxy repository?

From Dev

Maven failing to find jar from Project Repository

From Java

How to download sources for a jar with Maven?

From Java

Maven jar dependencies are displayed outside `Maven Dependencies` view

From Dev

gradle - task to only download maven dependencies

From Java

How to download dependencies inside a maven plugin?

From Java

Can't download maven dependencies in offline mode

From Java

Maven pre-download all dependencies

From Java

Ports and protocol used by Maven to download dependencies in Eclipse?

From Java

Using Maven to download dependencies to a directory on the command line

Related Related

  1. 1

    jar download with dependencies from maven

  2. 2

    failing to download a dependencies with sbt

  3. 3

    How to let bazel recursively download dependencies by maven_jar in java

  4. 4

    Maven dependencies are failing with a 501 error

  5. 5

    Maven download dependencies

  6. 6

    Maven fails to download dependencies

  7. 7

    Maven jar with dependencies?

  8. 8

    Including dependencies in a jar with Maven

  9. 9

    Building jar with dependencies maven

  10. 10

    maven build failing to download com.lowagie:itext:jar:2.1.7.js6 dependency

  11. 11

    Maven Dependencies downloaded but build is failing with StackOverflowError

  12. 12

    Spring 3.0.0 dependencies download with Maven

  13. 13

    Maven shade plugin - Jar and dependencies

  14. 14

    Maven not adding all dependencies to jar

  15. 15

    Maven deploy jar with dependencies to repo

  16. 16

    Maven: Add local dependencies to jar

  17. 17

    The maven dependencies are not added to the jar in eclipse

  18. 18

    Maven jar without dependencies by default

  19. 19

    Maven building a jar with dependencies unpacked inside the JAR

  20. 20

    Maven failing to download artifact from proxy repository?

  21. 21

    Maven failing to find jar from Project Repository

  22. 22

    How to download sources for a jar with Maven?

  23. 23

    Maven jar dependencies are displayed outside `Maven Dependencies` view

  24. 24

    gradle - task to only download maven dependencies

  25. 25

    How to download dependencies inside a maven plugin?

  26. 26

    Can't download maven dependencies in offline mode

  27. 27

    Maven pre-download all dependencies

  28. 28

    Ports and protocol used by Maven to download dependencies in Eclipse?

  29. 29

    Using Maven to download dependencies to a directory on the command line

HotTag

Archive