How can I update Maven Index manually? - eclipse

I have this problem:
When I start Eclipse (Indigo Service Release 1 with Maven Integration for Eclipse) it's trying to download a file from Maven Repositories :
repo1.maven.org/maven2/.index/nexus-maven-repository-index.gz
It reaches about 10-20% (this takes loooong) and then apparently it gives up:
02.05.12 08:47:36 MESZ: Updating index central|http://repo1.maven.org/maven2
02.05.12 09:09:25 MESZ: Unable to update index for central|http://repo1.maven.org/maven2
Now I tried to download this gz-file manually because I thought, the download hits any timeout within Eclipse. Now I have another two problems:
The direct download of the 48,7 MB-gz-file canceled after 9,6 MB. I have no clue why.
If I'd be able to download the gz-file, I don't know how to "put it into" Eclipse/Maven or tell Maven to use the file on my PC and not the repository repo1.maven.org.
Any helpful ideas or answers?

Delete the cache from .m2/repository/.cache/m2e.
Open your eclipse
Menu Windows > Preferences > Maven > User Settings > Update Settings
Eclipse will download it again, should work now.

Try to change the timeout settings like described here. I do not know which setting is responsible for the repository index update, you have to try a bit...
-Dsun.net.client.defaultReadTimeout=60000
-Dorg.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=60000
You should consider to disable the index update on startup (disable: Preferences -> Maven -> Download repository index updates on startup) and only update manually in the Maven Repositories View using the context menu on the central repository.

Well, that may be a little bit complicated but it worked for me:
First I used wget -c to download nexus-maven-repository-index.gz; took me about 10 retries and an hour; you may use any download manager you like
Second, installed Fiddler
Then updated <proxy> configuration in local maven settings.xml with Fiddler details
Enabled breakpoints in Fiddler
When Eclipse asked for nexus-maven-repository-index.gz used a Fiddler feature to substitute a response with a downloaded file

A more drastic way: delete the whole .metadata folder. Later import projects from their place or checkout them from the svn(if you use some). This is not much more complicated, but it helped. the problem is that we don't really know, what metadata are broken, so the natural next step is to delete all of them. I think, it is the deepest possible cleaning before reinstallation of Eclipse + plugins.

Related

Eclipse hangs on reverting resources

I use eclipse Indigo, subclipse 1.10.x and javaNL. Whenever I try to refresh my project in eclipse, it gets stuck at Reverting Resources 0% and Computing Update Requirements 0%. I try to kill eclipse and reopen the project and it still does the same. I do not understand why this happens. It started happening recently. Before it was working fine.
Question: I do not understand why this happens
General Answer: http://www.ihateeclipse.com/
(I may share this opinions and dont think Eclipse should be called a IDE but that wont fix your problem - hence lets proceed with possible workarounds).
Possible Workarounds:
1.) Starting eclipse in clean mode How to run eclipse in clean mode? and what happens if we do so?. (This solved aprox. 80% of my continuously returning 'I messed up my own state' issues I experienced).
2.) If that doesnt help - you would have to stop eclipse, identify the according files (or just any files holding such information) and delete them manually, then restart eclipse. Like I still encounter issues with my "Search Type" (Ctrl+T) and have to delete the files like described here Eclipse type hierarchy not always working (unfortunately I don't know anything about files regarding your current issue - so feel free to downvote my "answer" since its not directly answering your question).
The best things I found about "the full reset" seem to be: http://letsgetdugg.com/2009/04/19/recovering-a-corrupt-eclipse-workspace/ or http://blog.pdark.de/2011/09/02/restoring-a-corrupted-workspace-in-eclipse/ (Note: I haven't verified the described behaviors).
3.) Recreate Workspace - delete any eclipse belongings like the .metadata folder and keep only belongings of your project (e.g. sources, resources etc.). Then create a new eclipse project based on you existing project sources).
4.) If Steps 1-3 failed consider reinstalling Eclipse (include above Step 3 in this process again) or switching to a proper IDE that can at least handle its own state.
5.) I experienced rare cases where in the end such things were triggered by me rather than occurred magically out of nowhere by eclipse - I don't see any possibility on how you could manage that in your case unless you messed around with the eclipse source itself).
Hope this helps - Even thus the SO community is big I experienced way better results asking the eclipse developer community directly when it came to such specific issues (you however oftenly get a link to a open Bug ... that they created because of your question) and ended up "just importing into a new eclipse workspace from existing sources" whenever I experienced such issues lately (It takes me about 5 minutes to checkout our sources, start Eclipse with -clean as default and import existing Maven projects solving any eclipse-only issue - while each of those eclipse-issues can take days to be solved without any further advantage for my daily business)
I don't know if this will help any one but I had the same issue. Some links advised me to delete my metadata, which I did not want to do.
What fixed it for me was:
I have multiple eclipse workspaces, I manually closed my eclipse using the System Monitor/Taskbar as it wouldn't let me close as it was hanging.
I switched workspaces and it seems to run fine. So I switched back to the one that was hanging and the problem seemed to have gone.
This worked for me:
Go to to your workspace instalation, and manually delete the target directory under your maven projects (dont worry , maven will create another one when compiling). This removed my stuck Eclipse state (thread) in "Revert sources", always at 0%.
this helped me:
delete files "*.snap" under org.eclipse.core.resources in
worskpace/.metadata/.plugins/org.eclipse.core.resources/
and share project again (setup SVN settings)
I accidentally checked in target files to SVN. And the target files were huge ans hence it was stuck on reverting resources. Once I deleted those target files from SVN this issue never happened.But JBA's answer is pretty comprehensive so I will mark that as a right answer.
I have this same issue, and I just quickly cancel the "Rerverting Resources" task while it's in "waiting" mode when restart Eclipse.
This should work to 100% and helped in my case (no other tried solution worked):
Go to "Eclipse > Help > About Eclipse IDE > Installation Details
Uninstall the following packages "Subclipse", "Subclipse Integration for Mylyn", "Subversion 1.14 JavaHL", "Subversion Revision Graph", "SVN Client Adapter".
pluginsToUninstall
Go to the marketplace and install "subclipse" again.
Rightclick on your project > Team > Refresh/Cleanup
You are welcome. :)

Eclipse workspace issue with CCRC plugin error

Update 28 May 2013:
I have found a work around for this. Though this is not always works MOST of the time it does.
In Eclipse > Preferences > General > Startup and Shutdown
uncheck the option "ClearCase Remote Client plug-in"
Every time I start the problem workspace, before doing anything (like click on any resource or click on project in project explorer) I connect to the ClearCase repository.
This seems to calm down the error most of the time. Also, the Eclipse shortcut that I have on my desktop, has -clean option set in it. So when I start the eclipse my eclipse already starts with the clean up option. Though not sure if it has any bearing on the problem.
However not sure if this will help in a situation when I am working offline; when I can not connect to the ClearCase repository.
Update 21 May 2013:
At this time it looks like there is no resolution for this except a CCRC plugin upgrade.
For now marking VonC's answer as correct. Will update the post if I find a better solution.
I created a fresh new workspace and setup the workspace and so far I do not see any problems so far. Still not sure what was wrong with my workspace though.
==================================================
I have been having this problem for quite sometime on one of the workspace.
Error:
I am seeing the following error pop up with the error message; and will NOT go away.
An error has occurred. See error log for more details.
Could not initialize class com.ibm.rational.team.client.ui.model.common.ImageManager
Symptoms:
It happens only in one work space almost all the time.
Every time I restart this workspace, when ever I click on any projects in project explorer or any open file, it causes the error pop up to come up.
It goes away if I close all files, close the offending project and then delete the project. I fire up eclipse, re-import the project and the issue goes away only as long as I continue using the eclipse. Once I restart the eclipse the same problem persists.
What I have tried so far:
start eclipse with -clean option --> It does not solve the problem.
I have enabled the "Refresh workspace on startup" option in "Eclipse > Preferences > General > Startup and Shutdown" --> this does not solve theproblem.
I deleted the folder "org.eclipse.core.resources" under "Offending_Workspace > .metadata > .plugins" folder --> this has no effect. The problem persists as mentioned in Symptoms3 above.
System Info:
Windows 7 Enterprise Edition 64 bit.
Eclipse 3.7 Java EE developers
CCRC plugin Version: 7.1.0.0 , Build id: 7.1.1.03.00_2010C.D100803
Is there anything that can be done to resolve this. It's frustrating to work with such a broken plugin, that practically hinders ones work.
Any suggestion will be helpful.
This looks like PM38965 and there is no other solution than upgrading:
A fix is available in ClearCase versions 7.1.1.8, 7.1.2.5 and 8.0.0.1
You can see it listed in this release note:
PM38965:
Addresses a ClearCase issue where the ClearTeam Explorer produces a "Could not initialize class com.ibm.rational.team.client.ui.model.common.ImageManager" error intermittently when performing various operations.
The OP reports a workaround:
In Eclipse > Preferences > General > Startup and Shutdown, uncheck the option "ClearCase Remote Client plug-in"
Every time I start the problem workspace, before doing anything (like click on any resource or click on project in project explorer) I connect to the ClearCase repository.
This seems to calm down the error most of the time.
Also, the Eclipse shortcut that I have on my desktop, has '-clean' option set in it. So when I start the eclipse my eclipse already starts with the clean up option.
Though not sure if it has any bearing on the problem. However not sure if this will help in a situation when I am working offline; when I can not connect to the ClearCase repository.
The '-clean' being a local operation, it will have the same effect offline or online.

Eclipse : Maven search dependencies doesn't work

I created a new simple Maven project in a new Workspace.
When I open the pom.xml's Dependencies view in Eclipse editor, and I choose Add.. dependency, there's no search results no matter what search criteria I input in the search fields:
It instantly give me, for example, Results for 'spring' (0).
In my other workspace, with my existing projects I don't have this problem.
Is there a way to fix that ?
Eclipse artifact searching depends on repository's index file. It seems you did not download the index file.
Go to Window -> Prefrences -> Maven and check "Download repository index updates on start". Restart Eclipse and then look at the progress view. An index file should be downloading.
After downloading completely, artifact searching will be ready to use.
UPDATE
You also need to rebuild your Maven repository index in 'maven repository view'.
In this view , open 'Global Repositories', right-click 'central', check 'Full Index Enable',
and then, click 'Rebuild Index' in the same menu.
A 66M index file will be downloaded.
In your eclipse, go to Windows -> Preferences -> Maven
Tick the option "Download repository index updates on startup". You may want to restart the eclipse.
Also go to Windows -> Show view -> Other -> Maven -> Maven repositories
On Maven repositories panel, Expand Global repositories then Right click on Central repositories and check "Full index enabled" option and then click on "Rebuild index".
You can get this result if you are inside a corporate proxy and the new project isn't pointing to the correct settings.xml file with the proxy credentials.
You can also get this if you are using Maven proxy (Nexus, for example) and the index into the proxy is messed up somehow. I don't know a way to describe how to fix this. Fool around with it or call the one who set up the Maven proxy.
You can also get this if the new workspace hasn't yet downloaded the index either from Maven central or from the proxy. (This is the best one as you just have to wait a while and it will work itself out.)
For me for this issue worked to:
remove ~/.m2
enable "Full Index Enabled" in maven repository view on central repository
"Rebuild Index" on central maven repository
After eclipse restart everything worked well.
The maven add dependency is actually from the maven indexes. If the indexes is up to date, the result should be from there.
If you go to the maven repository, then select global repository, you should see a central ... tab, and select that, there should be a list of folders, and you should be able to see all the indexes from there. If not, then it means you didn't get the full index, then you can right click that and enable full index.
Another thing I annoyed me most is even I did everything, it still not showing anything when I type "spring". This is actually where I did wrong. If you just type some additional text "springframework", BOOM, the result is there.
I have the same problem. None of the options suggested above worked for me. However I find, that if I lets say manually add groupid/artifact/version for org.springframework.spring-core version 4.3.4.RELEASE and save the pom.xml, the dependencies download automatically and the search works for the jars already present in the repository.
However if I now search for org.springframework.spring-context , which isnt in the current dependencies, this search still doesn't work.
Use https://search.maven.org/ manually with the prefix fc: to search for class names. Both Netbeans and Eclipse seem to be too stupid to use that search interface and the gigabytes of downloaded repository indexes seem to not contain any class information. Total waste of disk space. Those IDE projects are so badly maintained lately, I wish they would move development to GitHub.
It is neccesary to provide Group Id and Artifact Id to download the jar file you need. If you want to search it just use * , * for these fields.

Searching for dependencies returns nothing

I've just installed Eclipse Juno with m2e installed.
Then, I've created a new Maven project and decided I want log4j, so I opened the pom.xml, clicked on the Dependency tab, clicked on the Add... button and typed in log4j.
Zero results. The only thing that it finds is junit (that was automatically added to the project with the quickstart archetype, it seems). Note that I can add the log4j dependency manually and it will work just fine, but I find the search feature really convenient!
I'm a kind of a Maven beginner, though I got m2e working no problem in Indigo. So I'm thinking I might have forgot to set something?
All you have to do is update or rebuild your workspace maven repository index.
Open your "Maven Repositories" view. Open Global Repositories and right-click on central. Enable full index and rebuild.
Initially the process will take several minutes. After that your search will start working.
You can automate this process by turning Download repository index updates on startup on in your workspace preferences under Maven
in case rebuilding your workspace maven repository index didn't work, try reinstalling m2e. I updated mine via marketplace and it started working again. I'm not sure what was the issue but I suspect some URLs got changed recently.
Just go to Window -> Preferences -> Maven
and check the option Download repository index updates on startup and click Apply. That's all.

Subclipse: Updating Change Sets for SVNStatusSubscriber (UPDATED - clock sync issue)

I see this when digging into the error logs of Eclipse - I keep getting an error:
An internal error occurred during:
"Updating Change Sets for
SVNStatusSubscriber"
It happens a few times when trying to update or commit, and eventually hoses my local copy of SVN, and I'm forced to rebuild it.
Has anyone every encountered either of these or have any thoughts on fixing? It's a huge annoyance to have to rebuild SVN each time. I'm using Subclipse with Helios. Also I'm connected via FUSE/SSHfs to the project on a VM.
Did samba fix it? Have you tried using different client implementations?
Okay, so this is still not 100% certain, but it would appear that what's happened is that the date goes out of sync on the VM on occassion. During svn updates or commits, this causes inconsistent synchronization data and the client in Eclipse, confused, ends up throwing errors.
Because the errors cause an abort of the update or commit process, this leaves the repository in a very unstable state, my guess is that it tries to retrieve a name of a file but gets back null, and ends up writing this back to the .svn/entries somehow.
As I said I can't confirm that this is the only thing causing the problems, but it makes sense as after my clock went out of sync, pretty much all of svn was broken on the next svn up call.
Hey so I had a similar issue, and this seems to have fixed the problem (keeping my fingures crossed that it stays fixed.)
right click on the project to open the options then set Team->Refresh/Cleanup. I am using a local repository so not sure if this will help you.
This is rather old however it has been viewed thousands of times which makes me feel that it's still a relevant issue. I arrived on this page because I had the same question.
The steps to fix the issue are
Ensure that you have an SVN client actually installed. (ex. if you are using Catalina make sure Catalina is actually installed)
If you are using extra tools on top of your SVN client such as TortoiseSVN ensure that it's installed. Most tools have co-dependencies to the official SVN release. (ex. TortoiseSVN versions closely match SVN versions)
Check if SubEclipse is installed (Help > Eclipse Marketplace > Type: subeclipse). When you update your SVN client SubEclipse needs to catch up. If you see the Install button available click it, most likely it will update SubEclipse to look at the right SVN client
If you get a Working-Copy error go to the actual folders in question through your OS and right click on the folders and choose "SVN Update"
If you are still having an issue in Eclipse choose your project(s) and right click > Team > Refresh/Cleanup. Then right click > Team > Synchronize with Repository
Hopefully one of the 5 steps will resolve your issue. In my case I had to do all 5.
As a solution to this problem, uninstall the svn client from eclipse. Go to Help -> about -> installation details -> select all subclipse plugins and click uninstall. After this install Subclipse from using subclipse update site. Don't forget to restart eclipse / STS whenever asked to do so.
Doing so solved my this problem. Hope this helps in your case as well.
I had the same problem, after creating some new classes. I've fixed it after synchronizing with repository of the parent package. the svn error "Updating Change Sets for SVNStatusSubscriber" disappered.
Changing the SVN client from eclipse with restart or start eclipse with "-clean" option didn't work for me.
My observation is that commonly the SVN commit fails, when there is a collision in XML files. SVN is not correctly reporting and updating XMLs. I had to delete (move the res folder to a temporary folder outside project) the entire folder, commit, restore the folder and commit again. I have not tried, but I think automatic build for Eclipse should be disabled before taking update. However you can get the version updates from team-->history, from there you can extract the updates to a folder, to compare the updates are done properly.