Example usage for org.apache.maven.lifecycle.internal TaskSegment isAggregating

List of usage examples for org.apache.maven.lifecycle.internal TaskSegment isAggregating

Introduction

In this page you can find the example usage for org.apache.maven.lifecycle.internal TaskSegment isAggregating.

Prototype

public boolean isAggregating() 

Source Link

Usage

From source file:io.sundr.maven.GenerateBomMojo.java

License:Apache License

private static TaskSegment filterSegment(TaskSegment segment, GoalSet goals) {
    List<Object> filtered = new ArrayList<Object>();

    Set<String> includes = goals.getIncludes();
    Set<String> excludes = goals.getExcludes();

    for (Object obj : segment.getTasks()) {
        String name = Reflections.readAnyField(obj, "pluginGoal", "lifecyclePhase");

        if (!excludes.contains(name) && (includes.contains(name) || includes.isEmpty())) {
            filtered.add(obj);//  ww w  . java2 s . c  om
        }
    }
    return new TaskSegment(segment.isAggregating(), filtered.toArray());
}