3

When ever I try to update Maven dependencies I get an error like - Could not calculate build plan:null. At first I used to get the error like

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): ConnectException

But, when I have made changes to settings.xml file and added repository and plugin repository in settings.xml like

<repository>
    <id>central</id>
    <url>http://central</url>
    <releases><enabled>true</enabled><updatePolicy>always</updatePolicy></releases>
    <snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots>
</repository>
<pluginRepository>
    <id>central</id>
    <url>http://central</url>
    <releases><enabled>true</enabled><updatePolicy>always</updatePolicy></releases>
    <snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots>
</pluginRepository>

The previous error was removed, but now I get the following error: Could not calculate build plan:null how to get rid of this error!! and also how to get rid of this warning

Classpath entry org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result. I tried to quick fix it, but whenever I reopen the project it again appears back. Any help would be appreciated.

user1227884
  • 31
  • 1
  • 4
  • Is there any solution for this problem? please help........ – user1227884 Dec 18 '12 at 15:28
  • possible duplicate? http://stackoverflow.com/questions/7430682/m2e-eclipse-indigo-gives-error – Brent Worden Dec 19 '12 at 17:08
  • I have tried solution #2 given by @akb and the problem is, when I change the url in LAN Settings, the .pac file is not being downloaded.... – user1227884 Dec 20 '12 at 15:11
  • @Brent Worden .....any solution I am trying hard to get this error resolved – user1227884 Dec 24 '12 at 15:56
  • To answer this question I think we're going to need to understand more about your connection to the internet. Also, try connecting to http://repo1.maven.org/maven2 - can you do so from a browser? – Tim O'Brien Dec 26 '12 at 18:40
  • @Tim O'Brien Yeah, I am able to connect to repo1.maven.org/maven2 through browser. But, I think the problem is with proxy settings, My settings.xml file does not have any pre-defined proxy settings and when I tried to add it, it is not working...This is what it is showing in *.LASTUPDATED **http\://central/.error=Could not transfer artifact org.apache.maven.plugins\:maven-surefire-plugin\:pom\:2.7.1 from/to central-proxy (http\://central)\: ConnectException** and this is the only file I can see in maven-surefire-plugin/2.7.1 folder... – user1227884 Dec 26 '12 at 19:31
  • Thanks for the help @Brent Worden and Tim O'Brien....atlast I got it.My proxy was manually configured, I have tried solution #2 instead of solution #1, now it's working. Made such an ignorant mistake..... – user1227884 Dec 26 '12 at 22:14
  • @user1227884 Feel free to post the answer to this question and accept it. Even though you are the author of the question, it is appropriate for you to accept your own answer being you did a lot of the research needed to find the solution. – Brent Worden Dec 27 '12 at 00:13

1 Answers1

0

I was able to solve this issue by enabling the proxy in settings.xml file located at config. At first tried different solutions by adding repository and pluginRepository in settings.xml file as mentioned in above question. But the actual problem was with the proxy configuration. I have tried the solution given by @akb at maven in 5 min not working. And the solution that worked out for me was Solution #1 as my organization's proxy setup was not auto-configured. Just included following data in settings.xml and do mvn clean, and update dependencies it worked.

<proxies>
  <proxy>
    <id>optional</id>
    <active>true</active>
    <protocol>http</protocol>
    <host>webproxy</host>
    <port>8080</port>
    <username>proxyuser</username>
    <password>proxypass</password>
  </proxy>
</proxies>
Community
  • 1
  • 1
user1227884
  • 31
  • 1
  • 4