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

View File

@ -256,7 +256,11 @@ public class DefaultMavenProjectBuilder
public MavenProject buildFromRepository( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository ) public MavenProject buildFromRepository( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
throws ProjectBuildingException 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; 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;
private Properties executionProperties = System.getProperties();
private List<ModelEventListener> listeners; private List<ModelEventListener> listeners;
@ -47,16 +46,6 @@ public class DefaultProjectBuilderConfiguration
private List<Profile> profiles; private List<Profile> profiles;
public DefaultProjectBuilderConfiguration()
{
}
public DefaultProjectBuilderConfiguration( ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
{
this.localRepository = localRepository;
this.remoteRepositories = remoteRepositories;
}
public MavenProject getTopLevelProjectFromReactor() public MavenProject getTopLevelProjectFromReactor()
{ {
return topProject; return topProject;
@ -132,6 +121,11 @@ public class DefaultProjectBuilderConfiguration
this.activeProfileIds = activeProfileIds; this.activeProfileIds = activeProfileIds;
} }
public void setProfiles( List<Profile> profiles )
{
this.profiles = profiles;
}
public void addProfile( Profile profile ) public void addProfile( Profile profile )
{ {
if ( profiles == null ) if ( profiles == null )

View File

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