当前位置: 首页>>代码示例>>Java>>正文


Java MavenSession.getGoals方法代码示例

本文整理汇总了Java中org.apache.maven.execution.MavenSession.getGoals方法的典型用法代码示例。如果您正苦于以下问题:Java MavenSession.getGoals方法的具体用法?Java MavenSession.getGoals怎么用?Java MavenSession.getGoals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.maven.execution.MavenSession的用法示例。


在下文中一共展示了MavenSession.getGoals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: afterProjectsRead

import org.apache.maven.execution.MavenSession; //导入方法依赖的package包/类
@Override
	public void afterProjectsRead(MavenSession session) throws MavenExecutionException {

		Set<String> goals = new HashSet<>(session.getGoals());

		if (goals.size() == 1 && goals.contains("clean")) {
			logger.info("Eccentric modularity not started (clean only session)! ");
			return;
		}

//		executionListener.setDelegate(session.getRequest().getExecutionListener());
//		session.getRequest().setExecutionListener(executionListener);
		logger.info("Eccentric modularity extension started!");
		
		
		List<MavenProject> allProjects = session.getProjects();
		for (MavenProject mavenProject : allProjects) {
			logger.info("Preparing " + mavenProject);
			executionListener.projectStarted(session.getProjectBuildingRequest(), mavenProject);
		}
		
	}
 
开发者ID:commsen,项目名称:EM,代码行数:23,代码来源:EccentricModularityMavenLifecycleParticipant.java

示例2: calculateTaskSegments

import org.apache.maven.execution.MavenSession; //导入方法依赖的package包/类
public List<TaskSegment> calculateTaskSegments( MavenSession session )
    throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
    MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
    PluginVersionResolutionException, LifecyclePhaseNotFoundException, LifecycleNotFoundException
{

    MavenProject rootProject = session.getTopLevelProject();

    List<String> tasks = session.getGoals();

    if ( tasks == null || tasks.isEmpty() )
    {
        if ( !StringUtils.isEmpty( rootProject.getDefaultGoal() ) )
        {
            tasks = Arrays.asList( StringUtils.split( rootProject.getDefaultGoal() ) );
        }
    }

    return calculateTaskSegments( session, tasks );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:21,代码来源:DefaultLifecycleTaskSegmentCalculator.java

示例3: requiresProject

import org.apache.maven.execution.MavenSession; //导入方法依赖的package包/类
public boolean requiresProject( MavenSession session )
{
    List<String> goals = session.getGoals();
    if ( goals != null )
    {
        for ( String goal : goals )
        {
            if ( !isGoalSpecification( goal ) )
            {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:16,代码来源:DefaultLifecycleTaskSegmentCalculator.java


注:本文中的org.apache.maven.execution.MavenSession.getGoals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。