用m2eclipse创建Maven项目时报错

用m2eclipse创建Maven项目时报错


问题:

Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from/to central (http://repo1.maven.org/maven2): Access denied to http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.7.1/maven-surefire-plugin-2.7.1.pom. Error code 407, Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied.  ) log4j-test01 Unknown Maven Problem


解决方法:

1.找到maven库目录,进入:~\.m2\repository\org\apache\maven\plugins\maven-surefire-plugin\2.7.1

2.若2.7.1目录下只有,"maven-surefire-plugin-2.7.1.pom.lastUpdated" 则需要到http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.7.1/,把里面的文件下载下来放到2.7.1

3.删除2.7.1下的maven-surefire-plugin-2.7.1.pom.lastUpdated文件。

4.项目右键-->maven-->Update Dependencies




看这篇文章:http://stackoverflow.com/questions/5074063/maven-problem-failure-to-transfer

4 down vote favorite
share [fb] share [tw]

I am trying to set up a project using Maven. I am behind a proxy, and am not sure if Maven is able to connect to the Internet. I have done the settings in 'settings.xml' for configuring Maven behind a proxy, but I get this error in Eclipse:

Description Resource Path Location Type Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from http://repo1.maven.org/maven2was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from/to central (http://repo1.maven.org/maven2): No response received after 60000 ExampleProject Unknown Maven Problem

Any ideas? It would be helpful if you could show me how to check if everything is configured fine...

link | improve this question

http://stackoverflow.com/questions/5074063/maven-problem-failure-to-transfer
4 down vote favorite
share [fb] share [tw]

I am trying to set up a project using Maven. I am behind a proxy, and am not sure if Maven is able to connect to the Internet. I have done the settings in 'settings.xml' for configuring Maven behind a proxy, but I get this error in Eclipse:

Description Resource Path Location Type Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from http://repo1.maven.org/maven2was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from/to central (http://repo1.maven.org/maven2): No response received after 60000 ExampleProject Unknown Maven Problem

Any ideas? It would be helpful if you could show me how to check if everything is configured fine...

link | improve this question

http://stackoverflow.com/questions/5074063/maven-problem-failure-to-transfer

4 down vote favorite
share [fb] share [tw]

I am trying to set up a project using Maven. I am behind a proxy, and am not sure if Maven is able to connect to the Internet. I have done the settings in 'settings.xml' for configuring Maven behind a proxy, but I get this error in Eclipse:

Description Resource Path Location Type Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from http://repo1.maven.org/maven2was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from/to central (http://repo1.maven.org/maven2): No response received after 60000 ExampleProject Unknown Maven Problem

Any ideas? It would be helpful if you could show me how to check if everything is configured fine...

link | improve this question

5 Answers

active oldest votes
up vote 4 down vote

Thanks for the replies, but after some more searching I was able to fix the problem. It turned out that I had to remove one of the "*.lastUpdated" which was preventing one of my plugins (Maven Surefire Plugin) from updating. I did this manually, because a maven clean wasn't doing it apparently. I'm not sure, but possibly Lev Khomich's solution might have worked.

The problem was that the "*.lastUpdated" file for a plugin was blocking the maven check for updates and not allowing a necessary jar to get downloaded.

link | improve this answer
 
Maybe it's obvious, but I'd just like to add: After manually looking for the specified *.lastUpdated file in maven repository (surefire's one in my case), and deleting it, one has to clean the project in Eclipse. –  superjos  Jul 3 at 18:36
feedback
up vote 2 down vote

Try to execute

mvn -U clean

or Run > Maven Clean and Maven > Update snapshots from project context menu in eclipse

link | improve this answer
 
feedback
up vote 2 down vote

I had similar issue in Eclipse 3.6 with m2eclipse.

Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 from central (http://repo1.maven.org/maven2): ConnectException project1 Unknown Maven Problem

Deleting all maven*.lastUpdated files from my local reository (as Deepak Joy suggested) solved that problem.

link | improve this answer
 
feedback
up vote 0 down vote

If you are behind a proxy, you have to update the settings.xml file (under the conf folder of your MAVEN_HOME, the file itself contains information about the proxy settings) and additionally you may need to update your Eclipse Network Settings (Window->Preferences...-> type Network Connections).

Try using -X or --debug in order to get the debug output, this could provide additional information about the problem.

link | improve this answer

4 down vote favorite
share [fb] share [tw]

I am trying to set up a project using Maven. I am behind a proxy, and am not sure if Maven is able to connect to the Internet. I have done the settings in 'settings.xml' for configuring Maven behind a proxy, but I get this error in Eclipse:

Description Resource Path Location Type Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from http://repo1.maven.org/maven2was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from/to central (http://repo1.maven.org/maven2): No response received after 60000 ExampleProject Unknown Maven Problem

Any ideas? It would be helpful if you could show me how to check if everything is configured fine...

link | improve this question

你可能感兴趣的:(Java)