mirror of
https://github.com/apache/maven.git
synced 2025-02-21 01:15:42 +00:00
Fix NullPointerException if build.properties file doesn't exist in user.home
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162536 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
02e654b28f
commit
15209dd9f1
@ -54,7 +54,7 @@ public void execute( String[] args )
|
||||
String basedir = args[0];
|
||||
|
||||
Properties properties = loadProperties( new File( System.getProperty( "user.home" ), "build.properties" ) );
|
||||
|
||||
|
||||
baseUrl = properties.getProperty( "maven.repo.remote" );
|
||||
|
||||
if ( baseUrl == null )
|
||||
@ -268,21 +268,19 @@ private Properties loadProperties( File file )
|
||||
// ignore
|
||||
}
|
||||
|
||||
return null;
|
||||
return new Properties();
|
||||
}
|
||||
|
||||
private static Properties loadProperties( InputStream is )
|
||||
{
|
||||
Properties properties = new Properties();
|
||||
|
||||
try
|
||||
{
|
||||
Properties properties = new Properties();
|
||||
|
||||
if ( is != null )
|
||||
{
|
||||
properties.load( is );
|
||||
}
|
||||
|
||||
return properties;
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
@ -303,7 +301,7 @@ private static Properties loadProperties( InputStream is )
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return properties;
|
||||
}
|
||||
|
||||
static class BootstrapPomParser
|
||||
|
Loading…
x
Reference in New Issue
Block a user