o Making mavenHomeLocal a optional argument.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163190 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Trygve Laugstol 2004-10-09 00:25:37 +00:00
parent 0bd570aa33
commit 91baa6e9b8
3 changed files with 27 additions and 6 deletions

View File

@ -87,12 +87,24 @@ public void initialize()
// MavenProjectBuilder Implementation
// ----------------------------------------------------------------------
public MavenProject build( File projectDescriptor )
throws ProjectBuildingException
{
return build( null, projectDescriptor, false );
}
public MavenProject build( File mavenLocalHome, File projectDescriptor )
throws ProjectBuildingException
{
return build( mavenLocalHome, projectDescriptor, false );
}
public MavenProject build( File projectDescriptor, boolean resolveDependencies )
throws ProjectBuildingException
{
return build( null, projectDescriptor, false );
}
/** @todo can we move the super model reading to the initialize method? what about the user/site? Is it reused?
* @todo this is still not completely faithful to the "always override" method of the user POM: there is potential for settings not to be used in some rare circumstances. Some restructuring is necessary.
* @todo we should be passing in some more configuration here so that maven home local can be used for user properties. Then, the new stuff should be unit tested.
@ -401,24 +413,27 @@ protected ArtifactRepository getLocalRepository( File mavenHomeLocal )
{
String localRepository = System.getProperty( "maven.repo.local" );
Model superModel = getSuperModel();
if ( !StringUtils.isEmpty( localRepository ) )
{
return RepositoryUtils.localRepositoryToWagonRepository( localRepository );
}
Model superModel = getSuperModel();
if ( superModel.getLocal() != null && superModel.getLocal().getRepository() != null )
{
localRepository = superModel.getLocal().getRepository();
}
if ( mavenHomeLocal != null )
{
Model userModel = getUserOverrideModel( superModel, mavenHomeLocal );
if ( userModel != null && userModel.getLocal() != null && userModel.getLocal().getRepository() != null )
{
localRepository = userModel.getLocal().getRepository();
}
}
if ( localRepository == null )
{

View File

@ -25,6 +25,12 @@ public interface MavenProjectBuilder
// ----------------------------------------------------------------------
MavenProject build( File project )
throws ProjectBuildingException;
MavenProject build( File project, boolean followTransitiveDeps )
throws ProjectBuildingException;
MavenProject build( File mavenHomeLocal, File project )
throws ProjectBuildingException;

BIN
mboot.jar

Binary file not shown.