public MavenProject build( File pom, ProjectBuilderConfiguration configuration ) throws ProjectBuildingException { ProjectBuildingRequest request = injectSession( toRequest( configuration ) ); try { return projectBuilder.build( pom, request ).getProject(); } catch ( ProjectBuildingException e ) { throw transformError( e ); } }
public MavenProject buildFromRepository( Artifact artifact, List<ArtifactRepository> remoteRepositories, ProjectBuilderConfiguration configuration, boolean allowStubModel ) throws ProjectBuildingException { ProjectBuildingRequest request = injectSession( toRequest( configuration ) ); request.setRemoteRepositories( normalizeToArtifactRepositories( remoteRepositories, request ) ); request.setProcessPlugins( false ); request.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL ); try { return projectBuilder.build( artifact, allowStubModel, request ).getProject(); } catch ( ProjectBuildingException e ) { throw transformError( e ); } }
public MavenProject buildWithDependencies( File pom, ArtifactRepository localRepository, ProfileManager profileManager, TransferListener transferListener ) throws ProjectBuildingException, ArtifactResolutionException, ArtifactNotFoundException { ProjectBuilderConfiguration configuration = new DefaultProjectBuilderConfiguration(); configuration.setLocalRepository( localRepository ); configuration.setGlobalProfileManager( profileManager ); ProjectBuildingRequest request = injectSession( toRequest( configuration ) ); request.setResolveDependencies( true ); try { return projectBuilder.build( pom, request ).getProject(); } catch ( ProjectBuildingException e ) { throw transformError( e ); } }