Search code examples
javaeclipseeclipse-pluginm2eclipsem2e

Eclipse plugin: how to read the "settings.xml" file path which is configured in M2Eclipse plugin


Now I'm developing a new Eclipse plugin, in this plugin I need to get the settings.xml file which is configured in m2Eclipse plugin and update it. I want to know whether the m2eclipse plugin has provided the related extension point so that I can use directly.

I've researched its user guide and the website, I cannot find any useful information for resolving my problem.

P.s: I'm not saying how to configure the settings.xml in maven plugin but developing a new plugin to read the settings.xml in m2eclipse.


Solution

  • You can have access to the user settings.xml path via

    MavenPlugin.getMavenConfiguration().getUserSettingsFile()

    And the global settings via

    MavenPlugin.getMavenConfiguration().getGlobalSettingsFile()