} else {
scaladocClassName = scalaClassName;
}
}
JavaMainCaller jcmd = getEmptyScalaCommand(scaladocClassName);
jcmd.addArgs(args);
jcmd.addJvmArgs(jvmArgs);
if (isPreviousScala271){
jcmd.addArgs("-Ydoc");
}
// copy the classpathElements to not modify the global project definition see https://github.com/davidB/maven-scala-plugin/issues/60
List<String> paths = new ArrayList<String>(project.getCompileClasspathElements());
paths.remove(project.getBuild().getOutputDirectory()); //remove output to avoid "error for" : error: XXX is already defined as package XXX ... object XXX {
if (!paths.isEmpty())jcmd.addOption("-classpath", MainHelper.toMultiPath(paths));
//jcmd.addOption("-sourcepath", sourceDir.getAbsolutePath());
boolean isScaladoc2 = (new VersionNumber("2.8.0").compareTo(sv) <= 0 || sv.isZero()) && ("scala.tools.nsc.ScalaDoc".equals(scaladocClassName));
if (isScaladoc2) {
jcmd.addArgs("-doc-format:html");
jcmd.addOption("-doc-title", doctitle);
} else {
jcmd.addOption("-bottom", getBottomText());
jcmd.addOption("-charset", charset);
jcmd.addOption("-doctitle", doctitle);
jcmd.addOption("-footer", footer);
jcmd.addOption("-header", header);
jcmd.addOption("-linksource", linksource);
jcmd.addOption("-nocomment", nocomment);
jcmd.addOption("-stylesheetfile", stylesheetfile);
jcmd.addOption("-top", top);
jcmd.addOption("-windowtitle", windowtitle);
}
return jcmd;
}