當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。