Eclipse插件:如何读取“settings.xml”在M2Eclipse插件中配置的文件路径(Eclipse plugin: how to read the "settings.xml" file path which is configured in M2Eclipse plugin)

197 IT屋

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.

解决方案

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

MavenPlugin.getMavenConfiguration().getUserSettingsFile()

And the global settings via

MavenPlugin.getMavenConfiguration().getGlobalSettingsFile()

现在我正在开发一个新的Eclipse插件,在这个插件中,我需要获取在m2Eclipse插件中配置的settings.xml文件并进行更新。我想知道m2eclipse插件是否提供了相关的扩展点,以便我可以直接使用。



我研究了其用户指南和网站,我找不到任何有用的信息解决我的问题。



Ps:我不是说如何配置maven插件中的settings.xml,而是开发一个新的插件来读取设置。 xml in m2eclipse。


解决方案

您可以通过


$访问用户settings.xml路径b $ b

MavenPlugin.getMavenConfiguration()。getUserSettingsFile()




全局设置通过




MavenPlugin.getMavenConfiguration()。getGlobalSettingsFile()



本文地址:IT屋 » Eclipse插件:如何读取“settings.xml”在M2Eclipse插件中配置的文件路径