And*_*dre 39 java windows maven
我有一个非常简单的默认应用程序,我在Windows 7机器上测试我的Eclipse Indigo/Maven v3.0.1设置.Hello World应用程序在Eclipse中运行良好.
现在从命令行我试图测试mvn install.
在这一点上,我看到Maven下载了一大堆依赖项.出于某种原因,虽然它会卡住下载一个,并将停止一部分.它不是每次都在同一点,但它目前始终是相同的jar文件,例如......
http://repo1.maven.org/maven2/org/apache/maven/surefire/surefire-booter/2.5/surefire-booter-2.5.jar
如果我从浏览器下载此文件,它可以很好地工作.事实上相当快.现在,如果我手动将下载的文件复制到我的.m2存储库目录中的相应目录,则安装将继续下载依赖项,直到它随机访问另一个依赖项,然后停止.
这是我的POM,虽然我不确定它会有什么帮助,因为它是如此基本,似乎可以正常工作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>
Run Code Online (Sandbox Code Playgroud)
这里有一些调试输出引用一些虚拟jar文件?
[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)
Run Code Online (Sandbox Code Playgroud)
小智 16
我有同样的问题.就我而言,AVG防病毒软件阻止了Maven下载工件.暂时禁用它有帮助.
小智 12
好的伙计们,我在下载大文件时遇到同样的问题.我们都可能使用轻量级HTTP旅行车.如果你看看文档:
http://maven.apache.org/wagon/wagon-providers/wagon-http-lightweight/
已知限制:
主要限制是您无法下载不完全适合内存的数据.
所以我增加了Maven的内存:
export MAVEN_OPTS="-Xmx1024m"
瞧,它有效.(!!!!)
那么它的价值是什么,这就是我所遇到的问题的答案.
如果我在v3.0.1离开Maven,我必须添加上面列出的镜像,它工作正常.
如果我将Maven升级到v3.0.3,那么我必须删除上面列出的镜像才能使其正常工作.:-)
我在两台独立的机器上试过这个并且行为相同.这可能意味着这里的网络应该归咎于它们都通过相同的路由器.
无论如何,那里基本上有两种解决方法.我不确定两者是否是"正确的"反应,但它们至少使我前进.
感谢所有提交的答案.
| 归档时间: |
|
| 查看次数: |
82693 次 |
| 最近记录: |