private boolean isLastModuleInProject ( Set < MavenProject > executedModules , List < MavenProject > projectModules ) { Set < MavenProject > remainingModules = new HashSet <> ( ) ; if ( execution . getPlugin ( ) . getExecutions ( ) . isEmpty ( ) ) { getLog ( ) . debug ( "No configured executions found, assuming CLI invocation." ) ; remainingModules . addAll ( projectModules ) ; } else { for ( MavenProject projectModule : projectModules ) { if ( ProjectResolver . containsBuildPlugin ( projectModule , execution . getPlugin ( ) ) ) { remainingModules . add ( projectModule ) ; } } } remainingModules . removeAll ( executedModules ) ; remainingModules . remove ( currentProject ) ; if ( remainingModules . isEmpty ( ) ) { getLog ( ) . debug ( "Did not find any subsequent module with a plugin configuration." + " Will consider this module as the last one." ) ; return true ; } else { getLog ( ) . debug ( "Found " + remainingModules . size ( ) + " subsequent modules possibly executing this plugin." + " Will NOT consider this module as the last one." ) ; return false ; } }
Determines if the last module for a project is currently executed .