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.
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>