protected Set < Plugin > getBoundPlugins ( LifecycleExecutor life , MavenProject project , String thePhases ) throws PluginNotFoundException , LifecycleExecutionException , IllegalAccessException { Set < Plugin > allPlugins = new HashSet < Plugin > ( ) ; // lookup the bindings for all the passed in phases String [ ] lifecyclePhases = thePhases . split ( "," ) ; for ( int i = 0 ; i < lifecyclePhases . length ; i ++ ) { String lifecyclePhase = lifecyclePhases [ i ] ; if ( StringUtils . isNotEmpty ( lifecyclePhase ) ) { try { Lifecycle lifecycle = getLifecycleForPhase ( lifecyclePhase ) ; allPlugins . addAll ( getAllPlugins ( project , lifecycle ) ) ; } catch ( BuildFailureException e ) { // i'm going to swallow this because the // user may have declared a phase that // doesn't exist for every module. } } } return allPlugins ; }
Gets the plugins that are bound to the defined phases . This does not find plugins bound in the pom to a phase later than the plugin is executing .