protected String getClasspath()
            throws MojoExecutionException {
        try {
            final List classpath = new ArrayList();
            // Loading self dependencies
            final List scopesToUse = new ArrayList();
            scopesToUse.add(Artifact.SCOPE_COMPILE);
            scopesToUse.add(Artifact.SCOPE_RUNTIME);
            Iterator it = pluginArtifactMap.keySet().iterator();
            while (it.hasNext()) {
                Artifact artifact = (Artifact) pluginArtifactMap.get((String) it.next());
                if (scopesToUse.contains(artifact.getScope())) {
                    artifactResolver.resolve(artifact, remoteRepositories, localRepository);
                    classpath.add(artifact.getFile().getAbsolutePath());
                }
            }
            // Loading self
            final Artifact self = artifactFactory.createArtifact("org.n0pe.mojo",
                                                                 "ruby-maven-plugin",
                                                                 "0.1-SNAPSHOT",
                                                                 Artifact.SCOPE_RUNTIME,
                                                                 "maven-plugin");
            artifactResolver.resolve(self, remoteRepositories, localRepository);
            classpath.add(self.getFile().getAbsolutePath());
            // Building the classpath string
            it = classpath.iterator();
            final StringWriter sw = new StringWriter();
            while (it.hasNext()) {
                sw.append((String) it.next());
                if (it.hasNext()) {
                    sw.append(File.pathSeparator);
                }
            }
            return sw.toString();
        } catch (ArtifactResolutionException ex) {
            throw new MojoExecutionException(ex.getMessage(), ex);
        } catch (ArtifactNotFoundException ex) {
            throw new MojoExecutionException(ex.getMessage(), ex);
        }
    }