public Set<Plugin> getProfilePlugins( MavenProject project )
    {
        Set<Plugin> result = new HashSet<Plugin>();
        @SuppressWarnings( "unchecked" )
        List<Profile> profiles = project.getActiveProfiles();
        if ( profiles != null && !profiles.isEmpty() )
        {
            for ( Profile p : profiles )
            {
                BuildBase b = p.getBuild();
                if ( b != null )
                {
                    @SuppressWarnings( "unchecked" )
                    List<Plugin> plugins = b.getPlugins();
                    if ( plugins != null )
                    {
                        result.addAll( plugins );
                    }
                }
            }
        }
        return result;
    }
public Set < Plugin > getProfilePlugins ( MavenProject project ) { Set < Plugin > result = new HashSet < Plugin > ( ) ; @ SuppressWarnings ( "unchecked" ) List < Profile > profiles = project . getActiveProfiles ( ) ; if ( profiles != null && ! profiles . isEmpty ( ) ) { for ( Profile p : profiles ) { BuildBase b = p . getBuild ( ) ; if ( b != null ) { @ SuppressWarnings ( "unchecked" ) List < Plugin > plugins = b . getPlugins ( ) ; if ( plugins != null ) { result . addAll ( plugins ) ; } } } } return result ; }
Finds the plugins that are listed in active profiles.

@param project the project
@return the profile plugins