o try and start localizing the handling of -f, release poms, and normal poms to the embedder. just too much funk

going on in the core.


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@572388 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2007-09-03 16:52:37 +00:00
parent cc1ca10d74
commit 441b918f80
2 changed files with 11 additions and 27 deletions

View File

@ -512,13 +512,13 @@ public class DefaultMaven
if ( RELEASE_POMv4.equals( file.getName() ) )
{
getLogger().info( "NOTE: Using release-pom: " + file + " in reactor build." );
usingReleasePom = true;
}
MavenProject project = getProject(
MavenProject project = projectBuilder.build(
file,
localRepository,
settings,
globalProfileManager );
if ( isRoot )
@ -609,29 +609,6 @@ public class DefaultMaven
return projects;
}
public MavenProject getProject( File pom,
ArtifactRepository localRepository,
Settings settings,
ProfileManager globalProfileManager )
throws ProjectBuildingException, ArtifactResolutionException, ProfileActivationException
{
if ( pom.exists() )
{
if ( pom.length() == 0 )
{
throw new ProjectBuildingException(
"unknown",
"The file " + pom.getAbsolutePath() +
" you specified has zero length." );
}
}
return projectBuilder.build(
pom,
localRepository,
globalProfileManager );
}
// ----------------------------------------------------------------------
// Methods used by all execution request handlers
// ----------------------------------------------------------------------

View File

@ -75,9 +75,16 @@ public class DefaultMavenExecutionRequestPopulator
{
// Actual POM File
if ( request.getBaseDirectory() != null )
if ( request.getPomFile() == null && request.getBaseDirectory() != null )
{
request.setPomFile( new File( request.getBaseDirectory(), Maven.POMv4 ).getAbsolutePath() );
File pom = new File( request.getBaseDirectory(), Maven.RELEASE_POMv4 );
if ( !pom.exists() )
{
pom = new File( request.getBaseDirectory(), Maven.POMv4 );
}
request.setPomFile( pom.getAbsolutePath() );
}
if ( request.getSettings() == null )