Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341554

Summary: Index should not be in workspace/all workspaces
Product: z_Archived Reporter: Roel Spilker <R.Spilker>
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: igor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Roel Spilker CLA 2011-03-31 17:36:14 EDT
I have several workspaces on my computer. All have in the .metadata/.plugins/org.maven.ide.eclipse/nexus huge amounts of data. Furthermore, each time I create a new workspace, the indexer starts downloading the internet. I have two problems with this:
- No need for having the same data multiple times on the same PC
- For security reasons, I sometimes have my workspace on a different drive with limited capacity

I suggest 
- to have a setting for the location of the indexes
- make it possible to use the same indexes concurrently
- don't start indexing the workspace on creation (https://bugs.eclipse.org/bugs/show_bug.cgi?id=341551)
- possibly, use the localRepository location specified in settings.xml as a default

This is possibly a duplicate of MNGECLIPSE-1547, but I can't be sure based on that description.
Comment 1 Igor Fedorenko CLA 2011-03-31 17:51:17 EDT
m2e already shares remote index gz file under localRepo/.cache/m2e folder, so download is expected to happen only once no matter how many workspaces you have.

m2e also performs gz->lucene index processing only once and caches the results under localRepo/.cache/m2e too. fyi, this is very cpu expansive operation which can take several minutes even on modern hardware.

beyond that, maven indexer is based on lucene and as far as I understand it is not possible to share the same lucene index directory among multiple JVM instance, so we create workspace-specific copy of lucene index.

I don't see what else can be improved here but I am open for suggestions.
Comment 2 Roel Spilker CLA 2011-03-31 19:21:23 EDT
All documentation I've read suggests that is is possible to use lucene from multiple JVM's at the same time. That said, you cannot write from multiple JVMs at the same time. Lucene will create an index.lock file when an IndexWriter is active. 

See also http://wiki.apache.org/lucene-java/LuceneFAQ#What_is_the_purpose_of_write.lock_file.2C_when_is_it_used.2C_and_by_which_classes.3F
Comment 3 Igor Fedorenko CLA 2011-03-31 19:25:50 EDT
We do welcome patches ;-)
Comment 4 Roel Spilker CLA 2011-03-31 19:29:06 EDT
See also
http://wiki.apache.org/lucene-java/AvailableLockFactories#NativeFSLockFactory

The text mentions possible failures involving different classloaders in the
same JVM. That suggests that using different JVM's are not a problem...

I understand you welcome patches :-) I'll see what I can do, but not before the end of May :-(
Comment 5 Igor Fedorenko CLA 2011-08-01 02:05:02 EDT
Closing old bug reports. Please reopen if you have patch to contribute.
Comment 6 Denis Roy CLA 2021-04-19 13:26:28 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/