/** * Gets the settings file of this model source. * * @return The underlying settings file, never {@code null}. * @deprecated instead use {@link #getFile()} */ @Deprecated public File getSettingsFile() { return getFile(); } }
private SettingsSource getSettingsSource( File settingsFile, SettingsSource settingsSource ) { if ( settingsSource != null ) { return settingsSource; } else if ( settingsFile != null && settingsFile.exists() ) { return new FileSettingsSource( settingsFile ); } return null; }
if ( userSettings != null ) { if ( userSettings instanceof FileSettingsSource ) { mavenExecutionRequest.setUserSettingsFile( ( (FileSettingsSource) userSettings ).getSettingsFile() ); } else { try {
@Override public String toString() { return getLocation(); }
private static SettingsSource initUserSettingsSource() { String customSettings = System.getProperty( CUSTOM_SETTINGS_PROPERTY ); if (customSettings != null) { File customSettingsFile = new File( customSettings ); if (customSettingsFile.exists()) { return new FileSettingsSource( customSettingsFile ); } else { try { return new UrlSettingsSource( new URL( customSettings ) ); } catch (MalformedURLException e) { // Ignore } log.warn("Cannot find custom maven settings: " + customSettings); } } String userHome = System.getProperty( "user.home" ); if (userHome != null) { File userSettingsFile = new File( userHome + "/.m2/settings.xml" ); if (userSettingsFile.exists()) { return new FileSettingsSource( userSettingsFile ); } } else { log.warn("User home is not set"); } return null; } }
if ( userSettings != null ) { if ( userSettings instanceof FileSettingsSource ) { mavenExecutionRequest.setUserSettingsFile( ( (FileSettingsSource) userSettings ).getSettingsFile() ); } else { try {
private static SettingsSource initUserSettingsSource() { String customSettings = System.getProperty( CUSTOM_SETTINGS_PROPERTY ); if (customSettings != null) { File customSettingsFile = new File( customSettings ); if (customSettingsFile.exists()) { return new FileSettingsSource( customSettingsFile ); } else { try { return new UrlSettingsSource( new URL( customSettings ) ); } catch (MalformedURLException e) { // Ignore } log.warn("Cannot find custom maven settings: " + customSettings); } } String userHome = System.getProperty( "user.home" ); if (userHome != null) { File userSettingsFile = new File( userHome + "/.m2/settings.xml" ); if (userSettingsFile.exists()) { return new FileSettingsSource( userSettingsFile ); } } else { log.warn("User home is not set"); } return null; } }
/** * Gets the settings file of this model source. * * @return The underlying settings file, never {@code null}. * @deprecated instead use {@link #getFile()} */ @Deprecated public File getSettingsFile() { return getFile(); } }