Shekhar
Shekhar

Reputation: 11788

Eclipse build project "setting classpath containers" taking lot of time

I am facing strange problem with my Eclipse Indigo. I have one maven project and I wanted to run some JUnit test cases for some classes.

Whenever I try to run the test, eclipse hangs at 35% and text below that progress bar says that it is setting classpath containers.

This step takes long time. I have waited for more than 15 minutes also but then also tests are not running.

I was not able to exit from Eclipse because setting classpath containers step was still under progress. So I killed Eclipse process and restarted eclipse but then also same problem.

I tried to clean the project, updated maven dependencies and refreshed project but nothing helped.

Anyone knows why this problem comes in Eclipse? and how to resolve this issue?

Upvotes: 7

Views: 10574

Answers (2)

Jason Ridge
Jason Ridge

Reputation: 1

Encountered this exact problem myself and determined the cause for the "setting classpath containers" action taking a very long time (or appear to just hang) is a that there is a large amount of content in your build output folder (for maven projects, that is normally the folder/directory at {project_root}/target) and it is causing eclipse (for some reason) get stuck on the "setting classpath containers" action.

Try to following to resolve the problem:

  1. Close eclipse (you might have to kill pr end task eclipse to get it to close).
  2. To avoid deleting anything important, do a review your
    {project_root}/target folder and its contents to make sure there
    isn't anything in that folder that you placed there yourself (aka
    anything you know for sure you need to keep around and should not
    delete - would be a special case scenario).
  3. Open your favorite shell and remove everything under the {project_root}/target folder (excluding, of course, anything that you identified in step #2 that needs to remain).
  4. Re-launch eclipse and hopefully that problem is resolved.

Upvotes: 0

Syed Siraj Uddin
Syed Siraj Uddin

Reputation: 593

  1. You might have your maven settings.xml file in: c:\users\username\.m2\settings.xml
  2. where as your eclipse is pointing to "maven installation dir"\conf\settings.xml
  3. Change setting file path in eclipse,

window -> preferences -> maven -> usersettings -> to the one which have the right settings.xml file

This should fix the problem.

if you see the console, it might be actually trying to connect to some Jboss url to download your maven dependencies.

Upvotes: 4

Related Questions