用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

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

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

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

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

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

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

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

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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章