本文整理匯總了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;
}