Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] How to override the default settings in m2eclipse?

Hi all!

I'm writing a custom plugin which uses some functionality of m2eclipse. I would like the preferences of the m2eclipse plugin to have different default values. By this, I mean that currently the user settings file is set to ${user.dir}/.m2/settings.xml, and I'd like this to be something else, for example /opt/mvn/conf/settings.xml

This needs to be set on the plugin level, not on the workspace level. So if someone opens a new workspace, the default values need to be already in place. How to do this?

I've looked at the source code of MavenSettingsPreferencesPage, and I see that it uses the MavenCli class for retrieving its default values:

userSettingsText.setText(MavenCli.DEFAULT_USER_SETTINGS_FILE.getAbsolutePath());

The MavenCli class has the values hard-coded like this:

public static final String userHome = System.getProperty( "user.home" );
public static final File userMavenConfigurationHome = new File( userHome, ".m2" ); public static final File DEFAULT_USER_SETTINGS_FILE = new File( userMavenConfigurationHome, "settings.xml" );

So from this, it seems to me that it's not possible to override these values?

Thanks for all replies!

Csaba




Back to the top