o pass the active profile ids and profiles pass into the request

o clean up constructors for project builder configuration


git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@775284 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2009-05-15 18:45:48 +00:00
parent 01a13a3ffd
commit 392d49db54
4 changed files with 18 additions and 16 deletions

View File

@ -515,12 +515,12 @@ public class DefaultMavenExecutionRequest
return this;
}
public List getProfiles()
public List<Profile> getProfiles()
{
return profiles;
}
public MavenExecutionRequest setProfiles( List profiles )
public MavenExecutionRequest setProfiles( List<Profile> profiles )
{
this.profiles = profiles;
@ -651,6 +651,8 @@ public class DefaultMavenExecutionRequest
projectBuildingConfiguration.setLocalRepository( getLocalRepository() );
projectBuildingConfiguration.setExecutionProperties( getProperties() );
projectBuildingConfiguration.setRemoteRepositories( getRemoteRepositories() );
projectBuildingConfiguration.setActiveProfileIds( getActiveProfiles() );
projectBuildingConfiguration.setProfiles( getProfiles() );
projectBuildingConfiguration.setProcessPlugins( true );
}

View File

@ -256,7 +256,11 @@ public class DefaultMavenProjectBuilder
public MavenProject buildFromRepository( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
throws ProjectBuildingException
{
return buildFromRepository( artifact, new DefaultProjectBuilderConfiguration( localRepository, remoteRepositories ) );
ProjectBuilderConfiguration configuration = new DefaultProjectBuilderConfiguration()
.setLocalRepository( localRepository )
.setRemoteRepositories( remoteRepositories );
return buildFromRepository( artifact, configuration );
}
/**

View File

@ -34,8 +34,7 @@ public class DefaultProjectBuilderConfiguration
private List<ArtifactRepository> remoteRepositories;
//jvz Find out who added this. It's wrong, the execution properties are what come from the embedder setup not system properties.
private Properties executionProperties = System.getProperties();
private Properties executionProperties;
private List<ModelEventListener> listeners;
@ -46,17 +45,7 @@ public class DefaultProjectBuilderConfiguration
private List<String> activeProfileIds;
private List<Profile> profiles;
public DefaultProjectBuilderConfiguration()
{
}
public DefaultProjectBuilderConfiguration( ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
{
this.localRepository = localRepository;
this.remoteRepositories = remoteRepositories;
}
public MavenProject getTopLevelProjectFromReactor()
{
return topProject;
@ -132,6 +121,11 @@ public class DefaultProjectBuilderConfiguration
this.activeProfileIds = activeProfileIds;
}
public void setProfiles( List<Profile> profiles )
{
this.profiles = profiles;
}
public void addProfile( Profile profile )
{
if ( profiles == null )

View File

@ -46,5 +46,7 @@ public interface ProjectBuilderConfiguration
*/
void addProfile( Profile profile );
void setProfiles( List<Profile> profiles );
List<Profile> getProfiles();
}