當前位置: 首頁>>代碼示例>>Java>>正文


Java MavenSession.getProjectDependencyGraph方法代碼示例

本文整理匯總了Java中org.apache.maven.execution.MavenSession.getProjectDependencyGraph方法的典型用法代碼示例。如果您正苦於以下問題:Java MavenSession.getProjectDependencyGraph方法的具體用法?Java MavenSession.getProjectDependencyGraph怎麽用?Java MavenSession.getProjectDependencyGraph使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.maven.execution.MavenSession的用法示例。


在下文中一共展示了MavenSession.getProjectDependencyGraph方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: SmartBuilderImpl

import org.apache.maven.execution.MavenSession; //導入方法依賴的package包/類
SmartBuilderImpl(LifecycleModuleBuilder lifecycleModuleBuilder, MavenSession session,
    ReactorContext reactorContext, TaskSegment taskSegment, Set<MavenProject> projects) {
  this.lifecycleModuleBuilder = lifecycleModuleBuilder;
  this.rootSession = session;
  this.reactorContext = reactorContext;
  this.taskSegment = taskSegment;

  this.degreeOfConcurrency = Integer.valueOf(session.getRequest().getDegreeOfConcurrency());

  final Comparator<MavenProject> projectComparator = ProjectComparator.create(session);

  this.reactorBuildQueue = new ReactorBuildQueue(projects, session.getProjectDependencyGraph());
  this.executor = new ProjectExecutorService(degreeOfConcurrency, projectComparator);

  this.stats = ReactorBuildStats.create(projects);
}
 
開發者ID:takari,項目名稱:takari-smart-builder,代碼行數:17,代碼來源:SmartBuilderImpl.java

示例2: IncrementalModuleBuilderImpl

import org.apache.maven.execution.MavenSession; //導入方法依賴的package包/類
IncrementalModuleBuilderImpl( List<MavenProject> selectedProjects, LifecycleModuleBuilder lifecycleModuleBuilder,
                              MavenSession session, ReactorContext reactorContext, List<TaskSegment> taskSegments )
{

    this.lifecycleModuleBuilder =
        Objects.requireNonNull( lifecycleModuleBuilder, "lifecycleModuleBuilder is not allowed to be null." );
    this.mavenSession = Objects.requireNonNull( session, "session is not allowed to be null." );
    this.taskSegments = Objects.requireNonNull( taskSegments, "taskSegements is not allowed to be null" );
    this.reactorContext = Objects.requireNonNull( reactorContext, "reactorContext is not allowed to be null." );

    ProjectDependencyGraph projectDependencyGraph = session.getProjectDependencyGraph();

    List<MavenProject> intermediateResult = new LinkedList<>();

    for ( MavenProject selectedProject : selectedProjects )
    {
        intermediateResult.add( selectedProject );
        // Up or downstream ? (-amd)
        intermediateResult.addAll( projectDependencyGraph.getDownstreamProjects( selectedProject, true ) );
        // TODO: Need to think about this? -am ?
        // intermediateResult.addAll(projectDependencyGraph.getUpstreamProjects(selectedProject,
        // true));
    }

    List<MavenProject> result = new LinkedList<>();

    for ( MavenProject project : intermediateResult )
    {
        if ( !result.contains( project ) )
        {
            result.add( project );
        }
    }

    this.projects = result;

}
 
開發者ID:khmarbaise,項目名稱:incremental-module-builder,代碼行數:38,代碼來源:IncrementalModuleBuilderImpl.java

示例3: logWeavePlan

import org.apache.maven.execution.MavenSession; //導入方法依賴的package包/類
public void logWeavePlan( MavenSession session )
{
    if ( !logger.isInfoEnabled() )
    {
        return;
    }

    final ProjectDependencyGraph dependencyGraph = session.getProjectDependencyGraph();
    logger.info( "=== WEAVE CONCURRENCY BUILD PLAN ======================================" );
    for ( MavenProject mavenProject : dependencyGraph.getSortedProjects() )
    {

        StringBuilder item = new StringBuilder();
        item.append( "Project: " );
        item.append( mavenProject.getArtifactId() );
        final List<MavenProject> upstreamProjects = dependencyGraph.getUpstreamProjects( mavenProject, false );
        if ( upstreamProjects.size() > 0 )
        {
            item.append( " ( " );
            for ( Iterator<MavenProject> it = upstreamProjects.iterator(); it.hasNext(); )
            {
                final MavenProject kid = it.next();
                item.append( kid.getArtifactId() );
                if ( it.hasNext() )
                {
                    item.append( ", " );
                }
            }
            item.append( ")" );
        }
        logger.info( item.toString() );

    }
    logger.info( "=======================================================================" );
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:36,代碼來源:LifecycleDebugLogger.java

示例4: runWithCompletionService

import org.apache.maven.execution.MavenSession; //導入方法依賴的package包/類
private ProjectBuildList runWithCompletionService( ExecutorService service )
    throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
    MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
    PluginVersionResolutionException, LifecyclePhaseNotFoundException, LifecycleNotFoundException,
    ExecutionException, InterruptedException
{
    final ClassLoader loader = Thread.currentThread().getContextClassLoader();
    try
    {
        BuildListCalculator buildListCalculator = new BuildListCalculator();
        final MavenSession session = ProjectDependencyGraphStub.getMavenSession();
        List<TaskSegment> taskSegments = getTaskSegmentCalculator().calculateTaskSegments( session );
        ProjectBuildList projectBuildList = buildListCalculator.calculateProjectBuilds( session, taskSegments );

        final MojoExecutorStub mojoExecutorStub = new MojoExecutorStub();
        final LifecycleWeaveBuilder builder = getWeaveBuilder( mojoExecutorStub );
        final ReactorContext buildContext = createBuildContext( session );
        ReactorBuildStatus reactorBuildStatus = new ReactorBuildStatus( session.getProjectDependencyGraph() );
        builder.build( projectBuildList, buildContext, taskSegments, session, service, reactorBuildStatus );

        LifecycleExecutionPlanCalculatorStub lifecycleExecutionPlanCalculatorStub =
            new LifecycleExecutionPlanCalculatorStub();
        final int expected = lifecycleExecutionPlanCalculatorStub.getNumberOfExceutions( projectBuildList );
        assertEquals( "All executions should be scheduled", expected, mojoExecutorStub.executions.size() );
        return projectBuildList;
    }
    finally
    {
        Thread.currentThread().setContextClassLoader( loader );
    }
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:32,代碼來源:LifecycleWeaveBuilderTest.java

示例5: create

import org.apache.maven.execution.MavenSession; //導入方法依賴的package包/類
public static Comparator<MavenProject> create(MavenSession session) {
  final ProjectDependencyGraph dependencyGraph = session.getProjectDependencyGraph();
  return create0(DependencyGraph.fromMaven(dependencyGraph), ImmutableMap.of(), p -> id(p));
}
 
開發者ID:takari,項目名稱:takari-smart-builder,代碼行數:5,代碼來源:ProjectComparator.java

示例6: createBuildContext

import org.apache.maven.execution.MavenSession; //導入方法依賴的package包/類
private ReactorContext createBuildContext( MavenSession session )
{
    MavenExecutionResult mavenExecutionResult = new DefaultMavenExecutionResult();
    ReactorBuildStatus reactorBuildStatus = new ReactorBuildStatus( session.getProjectDependencyGraph() );
    return new ReactorContext( mavenExecutionResult, null, null, reactorBuildStatus );
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:7,代碼來源:LifecycleWeaveBuilderTest.java


注:本文中的org.apache.maven.execution.MavenSession.getProjectDependencyGraph方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。