用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:
Any ideas? It would be helpful if you could show me how to check if everything is configured fine... |
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:
Any ideas? It would be helpful if you could show me how to check if everything is configured fine... |
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:
Any ideas? It would be helpful if you could show me how to check if everything is configured fine... |
4
|
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. |
||
feedback
|
2
|
Try to execute
or Run > Maven Clean and Maven > Update snapshots from project context menu in eclipse |
||
feedback
|
2
|
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. |
|||
feedback
|
0
|
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. |
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:
Any ideas? It would be helpful if you could show me how to check if everything is configured fine... |