[MNG-4511] API incompatibility in MavenProjectBuilder (Maven-3)

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@895035 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-01-01 17:11:38 +00:00
parent 1520e0f8f3
commit 103a67cbaf
2 changed files with 40 additions and 0 deletions

View File

@ -23,6 +23,8 @@ import java.util.List;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.InvalidRepositoryException;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Repository;
import org.apache.maven.model.building.ModelBuildingException;
@ -32,6 +34,7 @@ import org.apache.maven.model.building.UrlModelSource;
import org.apache.maven.plugin.LegacySupport;
import org.apache.maven.profiles.ProfileManager;
import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.wagon.events.TransferListener;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
@ -209,4 +212,30 @@ public class DefaultMavenProjectBuilder
return buildStandaloneSuperProject( configuration );
}
public MavenProject buildWithDependencies( File project, ArtifactRepository localRepository,
ProfileManager profileManager, TransferListener transferListener )
throws ProjectBuildingException, ArtifactResolutionException, ArtifactNotFoundException
{
ProjectBuilderConfiguration configuration = new DefaultProjectBuilderConfiguration();
configuration.setLocalRepository( localRepository );
if ( profileManager != null )
{
configuration.setActiveProfileIds( profileManager.getExplicitlyActivatedIds() );
configuration.setInactiveProfileIds( profileManager.getExplicitlyDeactivatedIds() );
}
configuration.setResolveDependencies( true );
return build( project, configuration );
}
public MavenProject buildWithDependencies( File project, ArtifactRepository localRepository,
ProfileManager profileManager )
throws ProjectBuildingException, ArtifactResolutionException, ArtifactNotFoundException
{
return buildWithDependencies( project, localRepository, profileManager, null );
}
}

View File

@ -20,7 +20,10 @@ import java.util.List;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.profiles.ProfileManager;
import org.apache.maven.wagon.events.TransferListener;
@Deprecated
public interface MavenProjectBuilder
@ -53,4 +56,12 @@ public interface MavenProjectBuilder
MavenProject buildStandaloneSuperProject( ArtifactRepository localRepository, ProfileManager profileManager )
throws ProjectBuildingException;
MavenProject buildWithDependencies( File project, ArtifactRepository localRepository,
ProfileManager globalProfileManager, TransferListener transferListener )
throws ProjectBuildingException, ArtifactResolutionException, ArtifactNotFoundException;
MavenProject buildWithDependencies( File project, ArtifactRepository localRepository,
ProfileManager globalProfileManager )
throws ProjectBuildingException, ArtifactResolutionException, ArtifactNotFoundException;
}