Search code examples
eclipse-pluginm2eclipsem2e

how to call m2e plugin reindex API?


Does the m2e plugin provide the ability that other plugins can update the settings.xml file and call the eclipse maven plugin to reindex it?

in this link , I can read the configurations but it just provided the ability to read, so does the m2e plugin provide the API to update the settings.xml (such as changing the "localRepository") and reindex it? I can modify the settings.xml by code but it cannot active the m2e plugin to reindex.


Solution

  • There is no public API (it's likely we'll get rid of Nexus Index support in the future), but if you like living dangerously, you can try :

    MavenPlugin.getIndexManager().getLocalIndex().updateIndex(force, monitor);

    With MavenPlugin living in the org.eclipse.m2e.core package/plugin.