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
|
// MavenProjectBuilder Implementation
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
public MavenProject build( File projectDescriptor )
|
||||||
|
throws ProjectBuildingException
|
||||||
|
{
|
||||||
|
return build( null, projectDescriptor, false );
|
||||||
|
}
|
||||||
|
|
||||||
public MavenProject build( File mavenLocalHome, File projectDescriptor )
|
public MavenProject build( File mavenLocalHome, File projectDescriptor )
|
||||||
throws ProjectBuildingException
|
throws ProjectBuildingException
|
||||||
{
|
{
|
||||||
return build( mavenLocalHome, projectDescriptor, false );
|
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 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 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.
|
* @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 @@ public class DefaultMavenProjectBuilder
|
||||||
{
|
{
|
||||||
String localRepository = System.getProperty( "maven.repo.local" );
|
String localRepository = System.getProperty( "maven.repo.local" );
|
||||||
|
|
||||||
Model superModel = getSuperModel();
|
|
||||||
|
|
||||||
if ( !StringUtils.isEmpty( localRepository ) )
|
if ( !StringUtils.isEmpty( localRepository ) )
|
||||||
{
|
{
|
||||||
return RepositoryUtils.localRepositoryToWagonRepository( localRepository );
|
return RepositoryUtils.localRepositoryToWagonRepository( localRepository );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Model superModel = getSuperModel();
|
||||||
|
|
||||||
if ( superModel.getLocal() != null && superModel.getLocal().getRepository() != null )
|
if ( superModel.getLocal() != null && superModel.getLocal().getRepository() != null )
|
||||||
{
|
{
|
||||||
localRepository = superModel.getLocal().getRepository();
|
localRepository = superModel.getLocal().getRepository();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( mavenHomeLocal != null )
|
||||||
|
{
|
||||||
Model userModel = getUserOverrideModel( superModel, mavenHomeLocal );
|
Model userModel = getUserOverrideModel( superModel, mavenHomeLocal );
|
||||||
|
|
||||||
if ( userModel != null && userModel.getLocal() != null && userModel.getLocal().getRepository() != null )
|
if ( userModel != null && userModel.getLocal() != null && userModel.getLocal().getRepository() != null )
|
||||||
{
|
{
|
||||||
localRepository = userModel.getLocal().getRepository();
|
localRepository = userModel.getLocal().getRepository();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( localRepository == null )
|
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 )
|
MavenProject build( File mavenHomeLocal, File project )
|
||||||
throws ProjectBuildingException;
|
throws ProjectBuildingException;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue