src/main/java/org/codehaus/mojo/exec/AbstractExecMojo.java
protected void collectProjectArtifactsAndClasspath( List<Artifact> artifacts, List<Path> theClasspathFiles )
    {
        if ( addResourcesToClasspath )
        {
            for ( Resource r : project.getBuild().getResources() )
            {
                theClasspathFiles.add( Paths.get( r.getDirectory() ) );
            }
        }

        if ( "compile".equals( classpathScope ) )
        {
            artifacts.addAll( project.getCompileArtifacts() );
            if ( addOutputToClasspath )
            {
                theClasspathFiles.add( Paths.get( project.getBuild().getOutputDirectory() ) );
            }
        }
        else if ( "test".equals( classpathScope ) )
        {
            artifacts.addAll( project.getTestArtifacts() );
            if ( addOutputToClasspath )
            {
                theClasspathFiles.add( Paths.get( project.getBuild().getTestOutputDirectory() ) );
                theClasspathFiles.add( Paths.get( project.getBuild().getOutputDirectory() ) );
            }
        }
        else if ( "runtime".equals( classpathScope ) )
        {
            artifacts.addAll( project.getRuntimeArtifacts() );
            if ( addOutputToClasspath )
            {
                theClasspathFiles.add( Paths.get( project.getBuild().getOutputDirectory() ) );
            }
        }
        else if ( "system".equals( classpathScope ) )
        {
            artifacts.addAll( project.getSystemArtifacts() );
        }
        else
        {
            throw new IllegalStateException( "Invalid classpath scope: " + classpathScope );
        }

        getLog().debug( "Collected project artifacts " + artifacts );
        getLog().debug( "Collected project classpath " + theClasspathFiles );
    }
protected void collectProjectArtifactsAndClasspath( List<Artifact> artifacts, List<Path> theClasspathFiles )
    {
        if ( addResourcesToClasspath )
        {
            for ( Resource r : project.getBuild().getResources() )
            {
                theClasspathFiles.add( Paths.get( r.getDirectory() ) );
            }
        }

        if ( "compile".equals( classpathScope ) )
        {
            artifacts.addAll( project.getCompileArtifacts() );
            if ( addOutputToClasspath )
            {
                theClasspathFiles.add( Paths.get( project.getBuild().getOutputDirectory() ) );
            }
        }
        else if ( "test".equals( classpathScope ) )
        {
            artifacts.addAll( project.getTestArtifacts() );
            if ( addOutputToClasspath )
            {
                theClasspathFiles.add( Paths.get( project.getBuild().getTestOutputDirectory() ) );
                theClasspathFiles.add( Paths.get( project.getBuild().getOutputDirectory() ) );
            }
        }
        else if ( "runtime".equals( classpathScope ) )
        {
            artifacts.addAll( project.getRuntimeArtifacts() );
            if ( addOutputToClasspath )
            {
                theClasspathFiles.add( Paths.get( project.getBuild().getOutputDirectory() ) );
            }
        }
        else if ( "system".equals( classpathScope ) )
        {
            artifacts.addAll( project.getSystemArtifacts() );
        }
        else
        {
            throw new IllegalStateException( "Invalid classpath scope: " + classpathScope );
        }

        getLog().debug( "Collected project artifacts " + artifacts );
        getLog().debug( "Collected project classpath " + theClasspathFiles );
    }
Collects the project artifacts in the specified List and the project specific classpath (build output and build
test output) Files in the specified List, depending on the plugin classpathScope value.

@param artifacts the list where to collect the scope specific artifacts
@param theClasspathFiles the list where to collect the scope specific output directories