Maven remote index migration and refactoring#7976
Conversation
d848634 to
ac8c041
Compare
ac8c041 to
4a7b601
Compare
matthiasblaesing
left a comment
There was a problem hiding this comment.
Only eyeballed this, but looks good to me. Please consider to cleanup whitespace before merge. If you run "Search and Replace" with Regexp enabled and using the search pattern [ \t]+$ you see what I mean (I noticed that when diffing the two new files with the original implementation)
- moves about half of the code into a dedicated class - queries moved to NexusRepositoryQueries - index management remains in NexusRepositoryIndexManager
conditions: - both cache folders share the same parent - the cache folder is from an older release - the index itself is still somewhat up to date - current NB instance is not a dev build
4a7b601 to
f263bc1
Compare
|
good catch, not sure where this was from. I cleaned up |
|
Thank you. |
|
btw I forgot to mention that the main reason I extracted the queries is because this would make it a little bit easier to drop the remote index code if sonatype decides to discontinue their index - the local bits could be kept and selective queries reimplemented which call a service or use maven plugins which fetches metadata directly to the local repo. In any case the one class did too much at once. Thanks for reviewing! |
refactoring: split
NexusRepositoryIndexerImplto make it more maintainableNexusRepositoryQueriesNexusRepositoryIndexManagerautomatically move remote maven index from old into current cache, if:
note:
-J-Dmaven.indexing.diag.release=25can be used to simulate a release version. This would move the index from <25 into the cache forcurrentif above conditions apply (dev builds should not move anything). The index can be simply moved back by hand after testing.This was planned for a while and prepared in past by adding "lucene backwards codecs" but I never got to implementing it. Was also mentioned in #6365 (and other places).