code: private List<Artifact> getScopeArtifacts( final MavenProject project, final String scope )
      {
          if ( SCOPE_COMPILE.equals( scope ) )
          {
              return project.getCompileArtifacts();
          }
          if ( SCOPE_RUNTIME.equals( scope ) )
          {
              return project.getRuntimeArtifacts();
          }
          else if ( SCOPE_TEST.equals( scope ) )
          {
              return project.getTestArtifacts();
          }
          else
          {
              throw new RuntimeException( "Not allowed scope " + scope );
          }
      }
docs: Get artifacts for specific scope.
  
  @param project
  @param scope
  @return