mirror of https://github.com/apache/maven.git
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:
parent
0bd570aa33
commit
91baa6e9b8
|
@ -87,12 +87,24 @@ public class DefaultMavenProjectBuilder
|
|||
// 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,23 +413,26 @@ public class DefaultMavenProjectBuilder
|
|||
{
|
||||
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();
|
||||
}
|
||||
|
||||
Model userModel = getUserOverrideModel( superModel, mavenHomeLocal );
|
||||
|
||||
if ( userModel != null && userModel.getLocal() != null && userModel.getLocal().getRepository() != null )
|
||||
if ( mavenHomeLocal != null )
|
||||
{
|
||||
localRepository = userModel.getLocal().getRepository();
|
||||
Model userModel = getUserOverrideModel( superModel, mavenHomeLocal );
|
||||
|
||||
if ( userModel != null && userModel.getLocal() != null && userModel.getLocal().getRepository() != null )
|
||||
{
|
||||
localRepository = userModel.getLocal().getRepository();
|
||||
}
|
||||
}
|
||||
|
||||
if ( localRepository == null )
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue