@SuppressWarnings( "unchecked" )
    public static String createClassPath( MavenProject project, List<Artifact> pluginArtifacts, List<String> outDirs )
    {
        String cp = new String();
        Set<Artifact> classPathElements = Collections.synchronizedSet( new LinkedHashSet<Artifact>() );
        Set<Artifact> dependencyArtifacts = project.getDependencyArtifacts();
        classPathElements.addAll( dependencyArtifacts == null ? Collections.<Artifact>emptySet() : dependencyArtifacts );
        classPathElements.addAll( project.getArtifacts() );
        classPathElements.addAll( pluginArtifacts == null ? Collections.<Artifact>emptySet() : pluginArtifacts );
        for ( Artifact classPathElement  : classPathElements )
        {
            File artifact = classPathElement.getFile();
            if ( null != artifact )
            {
              String type = classPathElement.getType();
              if (!type.equals("pom")){
                cp += classPathElement.getFile().getAbsolutePath();
                cp += File.pathSeparatorChar;                
              }
            }
        }
        Iterator<String> outIter = outDirs.iterator();
        while ( outIter.hasNext() )
        {
            cp += outIter.next();
            cp += File.pathSeparatorChar;
        }

        if ( cp.endsWith( "" + File.pathSeparatorChar ) )
        {
            cp = cp.substring( 0, cp.length() - 1 );
        }

        cp = StringUtils.replace( cp, "//", "/" );
        return cp;
    }
@ SuppressWarnings ( "unchecked" ) public static String createClassPath ( MavenProject project , List < Artifact > pluginArtifacts , List < String > outDirs ) { String cp = new String ( ) ; Set < Artifact > classPathElements = Collections . synchronizedSet ( new LinkedHashSet < Artifact > ( ) ) ; Set < Artifact > dependencyArtifacts = project . getDependencyArtifacts ( ) ; classPathElements . addAll ( dependencyArtifacts == null ? Collections . < Artifact > emptySet ( ) : dependencyArtifacts ) ; classPathElements . addAll ( project . getArtifacts ( ) ) ; classPathElements . addAll ( pluginArtifacts == null ? Collections . < Artifact > emptySet ( ) : pluginArtifacts ) ; for ( Artifact classPathElement : classPathElements ) { File artifact = classPathElement . getFile ( ) ; if ( null != artifact ) { String type = classPathElement . getType ( ) ; if ( ! type . equals ( "pom" ) ) { cp += classPathElement . getFile ( ) . getAbsolutePath ( ) ; cp += File . pathSeparatorChar ; } } } Iterator < String > outIter = outDirs . iterator ( ) ; while ( outIter . hasNext ( ) ) { cp += outIter . next ( ) ; cp += File . pathSeparatorChar ; } if ( cp . endsWith ( "" + File . pathSeparatorChar ) ) { cp = cp . substring ( 0 , cp . length ( ) - 1 ) ; } cp = StringUtils . replace ( cp , "//" , "/" ) ; return cp ; }
Constructs AspectJ compiler classpath string

@param project the Maven Project
@param pluginArtifacts the plugin Artifacts
@param outDirs the outputDirectories
@return a os spesific classpath string