If your build fails because of a missing artifact, this is not an index problem. No indexing task can fix that type of failure.
Lucene Indexes in Nexus are used to support Maven 2 format repository search in the UI, they are not needed for builds.
This is important to keep in mind, many people get the idea that if the indexes are not 100% up to date there will be build failures.
Under "administration/scheduled tasks" you will find that there are a number of different indexing tasks available. Here's a brief rundown of the available tasks, and what they are used for.
In general running Update Indexes once a day is all you need to do to keep the Nexus search indexes up to date and in good working order.
Standard Indexing Tasks
- Download Indexes - Downloads and processes index updates from remote servers (like central)
- Publish Indexes - Publishes indexes so they can be downloaded by other clients (like other nexus instances, or m2eclipse)
- Update Indexes - Downloads incremental index updates for proxy repositories, publishes indexes for all repositories specified, and updates indexes to include new artifacts that were manually placed into a hosted repository storage directory, with a final optimization.
Advanced Indexing Tasks
- Repair Indexes - Rebuilds all indexes from scratch. It shouldn't be necessary to run this during normal operation. If you have this scheduled to run regularly, there is something wrong and the performance of Nexus will suffer.
- Optimize Indexes - Consolidates Lucene index files on disk. This can be run periodically in order to keep the Lucene indexes from growing too large. As the Update Indexes task already optimizes, running this on a regular basis is only needed in special cases.
The last sentence is not quite true. Both "update" and "repair" indexes optimize as their last step. Hence, in setup as above (daily update), there is no reason to have weekly optimize.
Checked the sources, optimize always happen.
We are closing this article for comments.
If you have a support license, please contact us by submitting a support ticket.
If you do not have a support license, please use our Nexus Users List or our other free support resources.