Hi, Why not using now : System.getenv() ? As we are now 1.5. It could prevent using the legacy stuff from p-u which "fork" a process depending on the os.
-- Olivier 2010/1/2 <[email protected]>: > Author: bentmann > Date: Sat Jan 2 17:44:37 2010 > New Revision: 895245 > > URL: http://svn.apache.org/viewvc?rev=895245&view=rev > Log: > [MNG-4379] Properties defined in parent POM and used in systemPath element > cause POM validation warnings and dependencies ignoration - compilation error > > Modified: > > maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java > > Modified: > maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java > URL: > http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java?rev=895245&r1=895244&r2=895245&view=diff > ============================================================================== > --- > maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java > (original) > +++ > maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java > Sat Jan 2 17:44:37 2010 > @@ -16,6 +16,7 @@ > */ > > import java.io.File; > +import java.io.IOException; > import java.util.ArrayList; > import java.util.Arrays; > import java.util.Collection; > @@ -25,7 +26,9 @@ > import java.util.LinkedHashSet; > import java.util.List; > import java.util.Map; > +import java.util.Properties; > import java.util.Set; > +import java.util.Map.Entry; > > import org.apache.maven.artifact.Artifact; > import org.apache.maven.artifact.ArtifactUtils; > @@ -34,7 +37,6 @@ > import org.apache.maven.artifact.metadata.ArtifactMetadataSource; > import org.apache.maven.artifact.metadata.ResolutionGroup; > import org.apache.maven.artifact.repository.ArtifactRepository; > -import org.apache.maven.artifact.repository.RepositoryRequest; > import > org.apache.maven.artifact.repository.metadata.ArtifactRepositoryMetadata; > import org.apache.maven.artifact.repository.metadata.Metadata; > import org.apache.maven.artifact.repository.metadata.RepositoryMetadata; > @@ -68,6 +70,7 @@ > import org.codehaus.plexus.component.annotations.Requirement; > import > org.codehaus.plexus.component.repository.exception.ComponentLookupException; > import org.codehaus.plexus.logging.Logger; > +import org.codehaus.plexus.util.cli.CommandLineUtils; > > /** > * @author Jason van Zyl > @@ -562,7 +565,7 @@ > configuration.setForceUpdate( > repositoryRequest.isForceUpdate() ); > configuration.setValidationLevel( > ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL ); > configuration.setProcessPlugins( false ); > - configuration.setSystemProperties( > System.getProperties() ); > + configuration.setSystemProperties( getSystemProperties() > ); > configuration.setTransferListener( > repositoryRequest.getTransferListener() ); > configuration.setServers( repositoryRequest.getServers() > ); > configuration.setMirrors( repositoryRequest.getMirrors() > ); > @@ -692,6 +695,28 @@ > return rel; > } > > + private Properties getSystemProperties() > + { > + Properties props = new Properties(); > + > + try > + { > + Properties envVars = CommandLineUtils.getSystemEnvVars(); > + for ( Entry<Object, Object> e : envVars.entrySet() ) > + { > + props.setProperty( "env." + e.getKey().toString(), > e.getValue().toString() ); > + } > + } > + catch ( IOException e ) > + { > + logger.debug( "Error getting environment variables: " + e ); > + } > + > + props.putAll( System.getProperties() ); > + > + return props; > + } > + > private static final class ProjectRelocation > { > private MavenProject project; > > > -- Olivier --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
