[ 
http://jira.codehaus.org/browse/MNG-2682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_101629
 ] 

Andrej Zachar commented on MNG-2682:
------------------------------------

Global Settings are still ignored

EmbedderFactory use for setup user and global settings following part:

  
    File userSettingsFile = MavenEmbedder.DEFAULT_USER_SETTINGS_FILE;
    if(validateConfiguration(userSettingsFile, logger)) {
      configuration.setUserSettingsFile(userSettingsFile);
    }
    
    if(globalSettings!=null && globalSettings.length()>0) {
      File globalSettingsFile = new File(globalSettings);
      if(validateConfiguration(globalSettingsFile, logger)) {
        configuration.setGlobalSettingsFile(globalSettingsFile);
      }
    }

Thus, global settings are never used by default from 
MavenEmbedder.DEFAULT_GLOBAL_SETTINGS_FILE) and user settings are ignored from 
preferences page.

anyway 

DEFAULT_GLOBAL_SETTINGS_FILE  is wrong initialized.

Instead of System.getPropety("maven.home) in new File( System
        .getProperty( "maven.home", System.getProperty( "user.dir", "" ) ), 
"conf/settings.xml" );

should be used 
System.getEnv("M2_HOME") (and/or System.getEnv("MAVEN_HOME") )

Otherwise it will use only user settings anyway!

Also i think that global settings and user settings should be located from 
default values when user do not override it in preferences.

If you want I can create a patch for it, that will be also propaged into 
preference pages.


> Global Settings are ignored
> ---------------------------
>
>                 Key: MNG-2682
>                 URL: http://jira.codehaus.org/browse/MNG-2682
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Embedding
>    Affects Versions: 2.0.4
>         Environment: Win XP, JDK1.6rc, m2eclipse 0.0.10 (trunk), eclipse 3.2.1
>            Reporter: Ralf Stoffels
>            Assignee: Jason van Zyl
>             Fix For: 2.1-alpha-1
>
>
> With the CLI both the global settings in $M2_HOME/conf/settings.xml and the 
> user settings in ${user.dir}/.m2/settings.xml are used.
> With the Embedder used by M2Eclipse only the user settings are used.
> So this issue is different from MNG-1884
> I hope this is fixed in 2.0.5 (-> MNG-1069).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to