mirror of https://github.com/apache/maven.git
o Optimized performance
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@895249 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
afb40dc0e9
commit
1957ff0de9
|
@ -101,6 +101,8 @@ public class MavenMetadataSource
|
|||
@Requirement
|
||||
private LegacySupport legacySupport;
|
||||
|
||||
private static Properties envVars;
|
||||
|
||||
private void injectSession( MetadataResolutionRequest request )
|
||||
{
|
||||
MavenSession session = legacySupport.getSession();
|
||||
|
@ -699,18 +701,25 @@ public class MavenMetadataSource
|
|||
{
|
||||
Properties props = new Properties();
|
||||
|
||||
try
|
||||
if ( envVars == null )
|
||||
{
|
||||
Properties envVars = CommandLineUtils.getSystemEnvVars();
|
||||
for ( Entry<Object, Object> e : envVars.entrySet() )
|
||||
Properties tmp = new Properties();
|
||||
try
|
||||
{
|
||||
props.setProperty( "env." + e.getKey().toString(), e.getValue().toString() );
|
||||
Properties env = CommandLineUtils.getSystemEnvVars();
|
||||
for ( Entry<Object, Object> e : env.entrySet() )
|
||||
{
|
||||
tmp.setProperty( "env." + e.getKey().toString(), e.getValue().toString() );
|
||||
}
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
logger.debug( "Error getting environment variables: " + e );
|
||||
}
|
||||
envVars = tmp;
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
logger.debug( "Error getting environment variables: " + e );
|
||||
}
|
||||
|
||||
props.putAll( envVars );
|
||||
|
||||
props.putAll( System.getProperties() );
|
||||
|
||||
|
|
Loading…
Reference in New Issue