public Collection<File> buildClasspathList( final MavenProject project, final String scope,
                                                Set<Artifact> artifacts, boolean isGenerator )
        throws ClasspathBuilderException
    {
        getLogger().debug( "establishing classpath list (scope = " + scope + ")" );

        Set<File> items = new LinkedHashSet<File>();

        // Note : Don't call addSourceWithActiveProject as a GWT dependency MUST be a valid GWT library module :
        // * include java sources in the JAR as resources
        // * define a gwt.xml module file to declare the required inherits
        // addSourceWithActiveProject would make some java sources available to GWT compiler that should not be accessible in
        // a non-reactor build, making the build less deterministic and encouraging bad design.

        if ( !isGenerator ) {
            items.add( new File( project.getBuild().getOutputDirectory() ) );
        }
        addSources( items, project.getCompileSourceRoots() );
        if ( isGenerator ) {
        	addResources( items, project.getResources() );
        }
        // Use our own ClasspathElements fitering, as for RUNTIME we need to include PROVIDED artifacts,
        // that is not the default Maven policy, as RUNTIME is used here to build the GWTShell execution classpath

        if ( scope.equals( SCOPE_TEST ) )
        {
            addSources( items, project.getTestCompileSourceRoots() );
            addResources( items, project.getTestResources() );
            items.add( new File( project.getBuild().getTestOutputDirectory() ) );

            // Add all project dependencies in classpath
            for ( Artifact artifact : artifacts )
            {
                items.add( artifact.getFile() );
            }
        }
        else if ( scope.equals( SCOPE_COMPILE ) )
        {
            // Add all project dependencies in classpath
            getLogger().debug( "candidate artifacts : " + artifacts.size() );
            for ( Artifact artifact : artifacts )
            {
                String artifactScope = artifact.getScope();
                if ( SCOPE_COMPILE.equals( artifactScope ) || SCOPE_PROVIDED.equals( artifactScope )
                    || SCOPE_SYSTEM.equals( artifactScope ) )
                {
                    items.add( artifact.getFile() );
                }
            }
        }
        else if ( scope.equals( SCOPE_RUNTIME ) )
        {
            // Add all dependencies BUT "TEST" as we need PROVIDED ones to setup the execution
            // GWTShell that is NOT a full JEE server
            for ( Artifact artifact : artifacts )
            {
                getLogger().debug( "candidate artifact : " + artifact );
                if ( !artifact.getScope().equals( SCOPE_TEST ) && artifact.getArtifactHandler().isAddedToClasspath() )
                {
                    items.add( artifact.getFile() );
                }
            }
        }
        else
        {
            throw new ClasspathBuilderException( "unsupported scope " + scope );
        }
        return items;
    }
public Collection < File > buildClasspathList ( final MavenProject project , final String scope , Set < Artifact > artifacts , boolean isGenerator ) throws ClasspathBuilderException { getLogger ( ) . debug ( "establishing classpath list (scope = " + scope + ")" ) ; Set < File > items = new LinkedHashSet < File > ( ) ; if ( ! isGenerator ) { items . add ( new File ( project . getBuild ( ) . getOutputDirectory ( ) ) ) ; } addSources ( items , project . getCompileSourceRoots ( ) ) ; if ( isGenerator ) { addResources ( items , project . getResources ( ) ) ; } if ( scope . equals ( SCOPE_TEST ) ) { addSources ( items , project . getTestCompileSourceRoots ( ) ) ; addResources ( items , project . getTestResources ( ) ) ; items . add ( new File ( project . getBuild ( ) . getTestOutputDirectory ( ) ) ) ; for ( Artifact artifact : artifacts ) { items . add ( artifact . getFile ( ) ) ; } } else if ( scope . equals ( SCOPE_COMPILE ) ) { getLogger ( ) . debug ( "candidate artifacts : " + artifacts . size ( ) ) ; for ( Artifact artifact : artifacts ) { String artifactScope = artifact . getScope ( ) ; if ( SCOPE_COMPILE . equals ( artifactScope ) || SCOPE_PROVIDED . equals ( artifactScope ) || SCOPE_SYSTEM . equals ( artifactScope ) ) { items . add ( artifact . getFile ( ) ) ; } } } else if ( scope . equals ( SCOPE_RUNTIME ) ) { for ( Artifact artifact : artifacts ) { getLogger ( ) . debug ( "candidate artifact : " + artifact ) ; if ( ! artifact . getScope ( ) . equals ( SCOPE_TEST ) && artifact . getArtifactHandler ( ) . isAddedToClasspath ( ) ) { items . add ( artifact . getFile ( ) ) ; } } } else { throw new ClasspathBuilderException ( "unsupported scope " + scope ) ; } return items ; }
Build classpath list using either gwtHome (if present) or using *project* dependencies. Note that this is ONLY
used for the script/cmd writers (so the scopes are not for the compiler, or war plugins, etc). This is required
so that the script writers can get the dependencies they need regardless of the Maven scopes (still want to use
the Maven scopes for everything else Maven, but for GWT-Maven we need to access deps differently - directly at
times).

@param project The maven project the Mojo is running for
@param artifacts the project artifacts (all scopes)
@param scope artifact scope to use
@param isGenerator whether to use processed resources and compiled classes (false), or raw resources (true).
@return file collection for classpath