mirror of https://github.com/apache/maven.git
o project builder takes a file now and not an input stream
o separated the construction of the domain model from the maven project git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@726951 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ff09f5beb7
commit
2dc15dda49
|
@ -21,7 +21,6 @@ package org.apache.maven.project.builder.impl;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -80,10 +79,7 @@ public final class DefaultProjectBuilder
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public PomClassicDomainModel buildModel( File pom, List<Model> inheritedModels,
|
||||||
* @see ProjectBuilder#buildFromLocalPath(java.io.InputStream, java.util.List, java.util.Collection, java.util.Collection, org.apache.maven.project.builder.PomArtifactResolver, java.io.File, org.apache.maven.project.ProjectBuilderConfiguration)
|
|
||||||
*/
|
|
||||||
public MavenProject buildFromLocalPath( File pom, List<Model> inheritedModels,
|
|
||||||
Collection<ImportModel> importModels,
|
Collection<ImportModel> importModels,
|
||||||
Collection<InterpolatorProperty> interpolatorProperties,
|
Collection<InterpolatorProperty> interpolatorProperties,
|
||||||
PomArtifactResolver resolver, File projectDirectory,
|
PomArtifactResolver resolver, File projectDirectory,
|
||||||
|
@ -170,14 +166,36 @@ public final class DefaultProjectBuilder
|
||||||
importModels,
|
importModels,
|
||||||
properties,
|
properties,
|
||||||
listeners ) );
|
listeners ) );
|
||||||
|
transformedDomainModel.setParentFile( parentFile );
|
||||||
|
|
||||||
|
return transformedDomainModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MavenProject buildFromLocalPath( File pom, List<Model> inheritedModels,
|
||||||
|
Collection<ImportModel> importModels,
|
||||||
|
Collection<InterpolatorProperty> interpolatorProperties,
|
||||||
|
PomArtifactResolver resolver, File projectDirectory,
|
||||||
|
ProjectBuilderConfiguration projectBuilderConfiguration )
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
PomClassicDomainModel domainModel = buildModel( pom,
|
||||||
|
inheritedModels,
|
||||||
|
importModels,
|
||||||
|
interpolatorProperties,
|
||||||
|
resolver,
|
||||||
|
projectDirectory,
|
||||||
|
projectBuilderConfiguration );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
MavenProject mavenProject = new MavenProject( transformedDomainModel.getModel(),
|
MavenProject mavenProject = new MavenProject( domainModel.getModel(),
|
||||||
artifactFactory,
|
artifactFactory,
|
||||||
mavenTools,
|
mavenTools,
|
||||||
null,
|
null,
|
||||||
projectBuilderConfiguration );
|
projectBuilderConfiguration );
|
||||||
mavenProject.setParentFile( parentFile );
|
|
||||||
|
mavenProject.setParentFile( domainModel.getParentFile() );
|
||||||
|
|
||||||
return mavenProject;
|
return mavenProject;
|
||||||
}
|
}
|
||||||
catch ( InvalidRepositoryException e )
|
catch ( InvalidRepositoryException e )
|
||||||
|
|
Loading…
Reference in New Issue