The following code snippet shows how to obtain NexusIndexer, IndexUpdater and IndexPacker components from the Plexus container or from the MavenEmbedder instance.
MavenEmbedder embedder; // get NexusIndexer component from Plexus PlexusContainer plexus = embedder.getPlexusContainer(); NexusIndexer indexer = (NexusIndexer) plexus.lookup(NexusIndexer.class); IndexUpdater updater = (IndexUpdater) plexus.lookup(IndexUpdater.class); IndexPacker packer = (IndexPacker) plexus.lookup(IndexPacker.class);See the NexusIndexer, IndexUpdater and IndexPacker documentation for more details how to work with these classes.