code: @SuppressWarnings( "unchecked" )
      private Set<Plugin> getAllPlugins( MavenProject project, Lifecycle lifecycle )
          throws PluginNotFoundException, LifecycleExecutionException
  
      {
          log.debug( "RequirePluginVersions.getAllPlugins:" );
  
          Set<Plugin> plugins = new HashSet<Plugin>();
          // first, bind those associated with the packaging
          Map mappings = findMappingsForLifecycle( project, lifecycle );
  
          Iterator iter = mappings.entrySet().iterator();
          while ( iter.hasNext() )
          {
              Entry entry = (Entry) iter.next();
              log.debug( "  lifecycleMapping = " + entry.getKey() );
              String pluginsForLifecycle = (String) entry.getValue();
              log.debug( "  plugins = " + pluginsForLifecycle );
              if ( StringUtils.isNotEmpty( pluginsForLifecycle ) )
              {
                  String pluginList[] = pluginsForLifecycle.split( "," );
                  for ( String plugin : pluginList )
                  {
                      plugin = StringUtils.strip( plugin );
                      log.debug( "    plugin = " + plugin );
                      String tokens[] = plugin.split( ":" );
                      log.debug( "    GAV = " + Arrays.asList( tokens ) );
  
                      Plugin p = new Plugin();
                      p.setGroupId( tokens[0] );
                      p.setArtifactId( tokens[1] );
                      plugins.add( p );
                  }
              }
          }
  
          List<String> mojos = findOptionalMojosForLifecycle( project, lifecycle );
          for ( String value : mojos )
          {
              String tokens[] = value.split( ":" );
  
              Plugin plugin = new Plugin();
              plugin.setGroupId( tokens[0] );
              plugin.setArtifactId( tokens[1] );
              plugins.add( plugin );
          }
  
          plugins.addAll( project.getBuildPlugins() );
  
          return plugins;
      }
docs: Gets the all plugins.
  
  @param project the project
  @param lifecycle the lifecycle
  @return the all plugins
  @throws PluginNotFoundException the plugin not found exception
  @throws LifecycleExecutionException the lifecycle execution exception