Replace usage of deprecated classes with their alternatives from maven-builder-support

This commit is contained in:
Robert Scholte 2014-12-23 17:21:07 +01:00
parent df21509310
commit 207ccc9529
1 changed files with 7 additions and 5 deletions

View File

@ -27,6 +27,8 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.maven.building.FileSource;
import org.apache.maven.building.Source;
import org.apache.maven.settings.Settings; import org.apache.maven.settings.Settings;
import org.apache.maven.settings.TrackableBase; import org.apache.maven.settings.TrackableBase;
import org.apache.maven.settings.io.SettingsParseException; import org.apache.maven.settings.io.SettingsParseException;
@ -86,11 +88,11 @@ public class DefaultSettingsBuilder
{ {
DefaultSettingsProblemCollector problems = new DefaultSettingsProblemCollector( null ); DefaultSettingsProblemCollector problems = new DefaultSettingsProblemCollector( null );
SettingsSource globalSettingsSource = Source globalSettingsSource =
getSettingsSource( request.getGlobalSettingsFile(), request.getGlobalSettingsSource() ); getSettingsSource( request.getGlobalSettingsFile(), request.getGlobalSettingsSource() );
Settings globalSettings = readSettings( globalSettingsSource, request, problems ); Settings globalSettings = readSettings( globalSettingsSource, request, problems );
SettingsSource userSettingsSource = Source userSettingsSource =
getSettingsSource( request.getUserSettingsFile(), request.getUserSettingsSource() ); getSettingsSource( request.getUserSettingsFile(), request.getUserSettingsSource() );
Settings userSettings = readSettings( userSettingsSource, request, problems ); Settings userSettings = readSettings( userSettingsSource, request, problems );
@ -135,7 +137,7 @@ public class DefaultSettingsBuilder
return false; return false;
} }
private SettingsSource getSettingsSource( File settingsFile, SettingsSource settingsSource ) private Source getSettingsSource( File settingsFile, Source settingsSource )
{ {
if ( settingsSource != null ) if ( settingsSource != null )
{ {
@ -143,12 +145,12 @@ public class DefaultSettingsBuilder
} }
else if ( settingsFile != null && settingsFile.exists() ) else if ( settingsFile != null && settingsFile.exists() )
{ {
return new FileSettingsSource( settingsFile ); return new FileSource( settingsFile );
} }
return null; return null;
} }
private Settings readSettings( SettingsSource settingsSource, SettingsBuildingRequest request, private Settings readSettings( Source settingsSource, SettingsBuildingRequest request,
DefaultSettingsProblemCollector problems ) DefaultSettingsProblemCollector problems )
{ {
if ( settingsSource == null ) if ( settingsSource == null )