本文整理汇总了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);
}
}
示例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 );
}
示例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;
}