mirror of https://github.com/apache/maven.git
o we don't need to deal with import models right now, all we care about in the near future are mixins. this is an attempt
to simplify the API enabling me to more easily create the specification tests git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@727210 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ee9e67af9b
commit
ff3548a6b4
|
@ -548,12 +548,10 @@ public class DefaultMavenProjectBuilder
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
mavenProject = projectBuilder.buildFromLocalPath( projectDescriptor,
|
mavenProject = projectBuilder.buildFromLocalPath( projectDescriptor,
|
||||||
Arrays.asList(
|
Arrays.asList( getSuperProject( config, projectDescriptor, true ).getModel() ),
|
||||||
getSuperProject( config, projectDescriptor, true ).getModel() ),
|
interpolatorProperties,
|
||||||
null,
|
resolver,
|
||||||
interpolatorProperties,
|
config );
|
||||||
resolver,
|
|
||||||
config );
|
|
||||||
}
|
}
|
||||||
catch ( IOException e )
|
catch ( IOException e )
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,15 +19,15 @@ package org.apache.maven.project.builder;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.maven.model.Model;
|
import org.apache.maven.model.Model;
|
||||||
import org.apache.maven.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.apache.maven.project.ProjectBuilderConfiguration;
|
import org.apache.maven.project.ProjectBuilderConfiguration;
|
||||||
import org.apache.maven.shared.model.*;
|
import org.apache.maven.shared.model.InterpolatorProperty;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides services for building maven projects from models.
|
* Provides services for building maven projects from models.
|
||||||
|
@ -36,9 +36,8 @@ public interface ProjectBuilder
|
||||||
{
|
{
|
||||||
public PomClassicDomainModel buildModel( File pom,
|
public PomClassicDomainModel buildModel( File pom,
|
||||||
List<Model> inheritedModels,
|
List<Model> inheritedModels,
|
||||||
Collection<ImportModel> importModels,
|
|
||||||
Collection<InterpolatorProperty> interpolatorProperties,
|
Collection<InterpolatorProperty> interpolatorProperties,
|
||||||
DefaultPomArtifactResolver resolver )
|
PomArtifactResolver resolver )
|
||||||
throws IOException;
|
throws IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,9 +54,8 @@ public interface ProjectBuilder
|
||||||
*/
|
*/
|
||||||
MavenProject buildFromLocalPath( File pom,
|
MavenProject buildFromLocalPath( File pom,
|
||||||
List<Model> inheritedModels,
|
List<Model> inheritedModels,
|
||||||
Collection<ImportModel> importModels,
|
|
||||||
Collection<InterpolatorProperty> interpolatorProperties,
|
Collection<InterpolatorProperty> interpolatorProperties,
|
||||||
DefaultPomArtifactResolver resolver,
|
PomArtifactResolver resolver,
|
||||||
ProjectBuilderConfiguration projectBuilderConfiguration )
|
ProjectBuilderConfiguration projectBuilderConfiguration )
|
||||||
throws IOException;
|
throws IOException;
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ import org.apache.maven.project.ProjectBuilderConfiguration;
|
||||||
import org.apache.maven.project.builder.ArtifactModelContainerFactory;
|
import org.apache.maven.project.builder.ArtifactModelContainerFactory;
|
||||||
import org.apache.maven.project.builder.IdModelContainerFactory;
|
import org.apache.maven.project.builder.IdModelContainerFactory;
|
||||||
import org.apache.maven.project.builder.DefaultPomArtifactResolver;
|
import org.apache.maven.project.builder.DefaultPomArtifactResolver;
|
||||||
|
import org.apache.maven.project.builder.PomArtifactResolver;
|
||||||
import org.apache.maven.project.builder.PomClassicDomainModel;
|
import org.apache.maven.project.builder.PomClassicDomainModel;
|
||||||
import org.apache.maven.project.builder.PomClassicDomainModelFactory;
|
import org.apache.maven.project.builder.PomClassicDomainModelFactory;
|
||||||
import org.apache.maven.project.builder.PomClassicTransformer;
|
import org.apache.maven.project.builder.PomClassicTransformer;
|
||||||
|
@ -74,14 +75,9 @@ public final class DefaultProjectBuilder
|
||||||
|
|
||||||
private Logger logger;
|
private Logger logger;
|
||||||
|
|
||||||
public DefaultProjectBuilder()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public PomClassicDomainModel buildModel( File pom, List<Model> inheritedModels,
|
public PomClassicDomainModel buildModel( File pom, List<Model> inheritedModels,
|
||||||
Collection<ImportModel> importModels,
|
|
||||||
Collection<InterpolatorProperty> interpolatorProperties,
|
Collection<InterpolatorProperty> interpolatorProperties,
|
||||||
DefaultPomArtifactResolver resolver )
|
PomArtifactResolver resolver )
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
if ( pom == null )
|
if ( pom == null )
|
||||||
|
@ -156,7 +152,7 @@ public final class DefaultProjectBuilder
|
||||||
PomClassicDomainModel transformedDomainModel = ( (PomClassicDomainModel) ctx.transform( domainModels,
|
PomClassicDomainModel transformedDomainModel = ( (PomClassicDomainModel) ctx.transform( domainModels,
|
||||||
transformer,
|
transformer,
|
||||||
transformer,
|
transformer,
|
||||||
importModels,
|
Collections.EMPTY_LIST,
|
||||||
properties,
|
properties,
|
||||||
listeners ) );
|
listeners ) );
|
||||||
transformedDomainModel.setParentFile( parentFile );
|
transformedDomainModel.setParentFile( parentFile );
|
||||||
|
@ -165,15 +161,13 @@ public final class DefaultProjectBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
public MavenProject buildFromLocalPath( File pom, List<Model> inheritedModels,
|
public MavenProject buildFromLocalPath( File pom, List<Model> inheritedModels,
|
||||||
Collection<ImportModel> importModels,
|
|
||||||
Collection<InterpolatorProperty> interpolatorProperties,
|
Collection<InterpolatorProperty> interpolatorProperties,
|
||||||
DefaultPomArtifactResolver resolver,
|
PomArtifactResolver resolver,
|
||||||
ProjectBuilderConfiguration projectBuilderConfiguration )
|
ProjectBuilderConfiguration projectBuilderConfiguration )
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
PomClassicDomainModel domainModel = buildModel( pom,
|
PomClassicDomainModel domainModel = buildModel( pom,
|
||||||
inheritedModels,
|
inheritedModels,
|
||||||
importModels,
|
|
||||||
interpolatorProperties,
|
interpolatorProperties,
|
||||||
resolver );
|
resolver );
|
||||||
|
|
||||||
|
@ -221,7 +215,7 @@ public final class DefaultProjectBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<DomainModel> getDomainModelParentsFromRepository( PomClassicDomainModel domainModel,
|
private List<DomainModel> getDomainModelParentsFromRepository( PomClassicDomainModel domainModel,
|
||||||
DefaultPomArtifactResolver artifactResolver )
|
PomArtifactResolver artifactResolver )
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
List<DomainModel> domainModels = new ArrayList<DomainModel>();
|
List<DomainModel> domainModels = new ArrayList<DomainModel>();
|
||||||
|
@ -261,7 +255,7 @@ public final class DefaultProjectBuilder
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
private List<DomainModel> getDomainModelParentsFromLocalPath( PomClassicDomainModel domainModel,
|
private List<DomainModel> getDomainModelParentsFromLocalPath( PomClassicDomainModel domainModel,
|
||||||
DefaultPomArtifactResolver artifactResolver,
|
PomArtifactResolver artifactResolver,
|
||||||
File projectDirectory )
|
File projectDirectory )
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue